Class UnitStringNormalizer

java.lang.Object
org.kigalisim.util.UnitStringNormalizer

public final class UnitStringNormalizer extends Object
Utility class for normalizing unit strings.

Normalization involves removing all whitespace from unit strings to ensure consistent comparison and processing. This class uses literal string replacement for optimal performance.

  • Method Details

    • normalize

      public static String normalize(String unitString)
      Remove all whitespace from a unit string.

      This method uses literal string replacement to remove spaces, which is significantly faster than regex pattern matching for this simple case.

      Parameters:
      unitString - The unit string to normalize
      Returns:
      The normalized unit string with all whitespace removed