substr()

Read(4241) Label: string, substring,

Description:

Find a substring and return the string after the substring.

Syntax:

substr(s1,s2,n)

Note:

The function finds the nth string named s2 in string s1 starting from the left and returns the string after s2; return null if there is nothing after s2.

Parameter:

s1

A string.

s2

A string.

n

A positive integer whose default value is 1.

Option:

@l

Return the string before s2; return null if there is nothing before s2.

@z

Perform the search from back to front.

@q

Skip the quoted string.

@c

Case-insensitive.

Return value:

String

Example:

=substr("abcdef","cd")

ef.

=substr@l("abcdef","cd")

ab.

=substr@q("ab\'cdef\'","cd")

No return value.

=substr@c("abCdef","cd")

ef.

substr("11-22-33","-",2)

33

substr@z("11-22-33","-",2)

22-33