String to integer

Strings Pure
String to integer
Text 0
Result

Description

Pure function parsing text as an integer. Whitespace is trimmed before parsing; non-numeric input fails the pipeline.

When to use

Use String to integer when a numeric value arrives as text — for example, from an HTTP request body or a CSV field — and you need to perform arithmetic on it. Validate that the input is non-empty with Is empty? before parsing to avoid pipeline failures on blank values. Non-numeric input will fail the pipeline, so guard with a Branch if the format is not guaranteed.

Pins

Input pins

Pin Type Default Notes
Text string 0 The string to parse. Leading and trailing whitespace is trimmed automatically before parsing.

Output pins

Pin Type Notes
Result integer The parsed integer value. Fails the pipeline if the text cannot be parsed as an integer.

Example

Add a fixed offset to a page number received as a query-string parameter. Read the body with Stream to string and feed the Value output into the Text input of String to integer. Wire the Result output into the A input of Add with B set to 1, then pass the Result output through Integer to string into Log message. The string “3” is parsed to the integer 3, incremented to 4, and logged as “4”.

See also