Category
Function
Extracts values from an input string.
Syntax
value, ... = Parse(input, format);
Inputs
Name | Type | Default | Description |
---|---|---|---|
input | string | none | string to be operated on |
format | string | "%s" | format control string |
Outputs
Name | Type | Description |
---|---|---|
value | value or string | value extracted from input string |
... | value or string | additional values extracted |
Functional Details
This module uses a format-control string (format) to extract values from a specified input string (input).
Note: The control string resembles a C-language scanf format string.
The "%" symbol in the control string specifies that extraction is to begin at the corresponding position in the input string. The character immediately following this symbol specifies the type of value to be extracted:
The number of outputs is equal to the number of extractions specified in format.
Example
Given the statements:
string = "temperature = 45.8 index = 4 color = red" format = "temperature = %f index = %d color = %s" output1, output2, output3 = Format(string, format);the three outputs of parse will be 45.8, 4, and "red."
Example Visual Program
UsingParse.net
See Also
[Data Explorer Home Page | Contact Data Explorer | Same document on Data Explorer Home Page ]