Adds numbers contained in two strings
Performs addition on strings that contain numeric values. Handles both pure numbers and strings with mixed content (e.g., "2 cups" + "1 cup" = "3 cups").
Left-hand side string
Right-hand side string
String containing the sum
sumNumberInString("2", "3") // "5"sumNumberInString("2 cups", "1 cup") // "3 cups" Copy
sumNumberInString("2", "3") // "5"sumNumberInString("2 cups", "1 cup") // "3 cups"
Adds numbers contained in two strings
Performs addition on strings that contain numeric values. Handles both pure numbers and strings with mixed content (e.g., "2 cups" + "1 cup" = "3 cups").