parse()

Read(2358) Label: analyze, corresponding data type,

Description:

Parse a string into the corresponding data type.

Syntax:

parse(s)

Note:

This function analyzes string s and parses it into corresponding data type.

Parameter:

s

A string

Option:

@e

Remove quotes of the string before starting an escape sequence including the escape character and unicode. By default, the string will not be escaped

@n

Retrieve a substring with enough length starting from the left side and parse it, while ignoring the non-numeric rest. Note that the string needs to begin with the numeric value

@q

If a string starts with the quotation marks, parse it until the next quotation marks appear and leave the rest of the string alone, and return a string

Return value:

Data of different data types

Example:

 

A

 

1

="10:20:30"

 

2

=parse(A1)

10:20:30. The string is parsed into time data type.

3

\u4e2d\u56fd

 

4

a\tb

 

5

=parse@e(A3)

中国. The string is automatically parsed into the corresponding Unicode characters.

6

=parse@e(A4)

a  b. Escape characters are handled automatically.

7

=parse@n("12sadsdxc23")

12. Retrieve and parse the first numeric value.

8

=parse@q("\'sadsdxc\'+23")

'sadsdxc'; the string begins with quotation marks and the parsing stops at the next quotation marks.