words()

Read(457) Label: extract, string, english words,

Here’s how to use words() function.

s .words()

Description

Extract 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 digits from string s

@a

Select both English words and substrings of digits from string s

@w

Extract all characters: a string in Chinese /a sign will be extracted as inidvidual characters and a string of English letters/a number as wha

@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 digits 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 English words form the string

3

=A1.words@d()

 

Extract digits form the string

4

=A1.words@a()

Extract English words and digits form the string

5

abc123好吗#?df34

 

6

=A5.words@w()

7

=A5.words@i()

Extract English letters in a row and continuous English letters plus digits as a whole

8

4,-8,899,0,my,test

 

9

=A8.words@d()

A digit string preceded with the hyphen “-” is parsed as a negative number

10

hi*-10hello2020-01-01go3.1415926

 

11

=A10.words@w()

12

=A10.words@wp()

The preceder of a digit or date is recognized as a part of a whole number or date data, like one in -10, 2020-01-01 and 3.1415926, according to the data type