Here’s how to use words() function.
Description:
Extract the English words from a string.
Syntax:
s.words()
Note:
The function returns a string sequence consisting of English words extracted from string s while other characters are ingnored.
Options:
@d |
Select the numbers out of the string s |
@a |
Select both the English words and the numbers out of the string s |
@w |
Extract all characters from a string; extract a string in Chinese /a sign as inidvidual characters and a string of English letters/a number as what they are |
@p |
Use with @w option to identify the preceder of a number or a datetime data as a part of it |
@i |
Treat English letters in a row and continuous English letters plus numbers as a whole |
Parameters:
s |
A string |
Return value:
A sequence of strings
Example:
|
A |
|
1 |
4,23,a,test?my_file 57 |
|
2 |
=A1.words() |
Extract the English words form the string |
3 |
=A1.words@d() |
Extract numers form the string |
4 |
=A1.words@a() |
Extract English words and numers form the string |
abc你123好吗#?df34 |
|
|
6 |
=A5.words@w() |
|
7 |
=A5.words@i() |
Extract English letters in a row and continuous English letters plus numbers as a whole |
8 |
4,-8,899,0,my,test |
|
9 |
=A8.words@d() |
A number string with the line sign “-” is parsed as a negative number |
10 |
hi*-10hello2020-01-01go3.1415926 |
|
11 |
=A10.words@w() |
|
12 |
=A10.words@wp() |
The preceder of each number or date is recognized as a part of the data, like -10, 2020-01-01 and 3.1415926, according to the data type |