Preparing search index...
    • Subtracts numbers contained in two strings

      Performs subtraction on strings that contain numeric values. Handles both pure numbers and strings with mixed content (e.g., "5 cups" - "2 cups" = "3 cups").

      Parameters

      • lhs: string

        Left-hand side string (minuend)

      • rhs: string

        Right-hand side string (subtrahend)

      Returns string

      String containing the difference

      subtractNumberInString("5", "2") // "3"
      subtractNumberInString("5 cups", "2 cups") // "3 cups"