Simulation of the Strings module
strings
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| GetStackValue | 1 | get string between two stack string |
| getBetweenString | 1 | get between string function is similar to the stack_str function, but this function will get the min length string between two flag |
| MidString | 1 | Returns a string that contains a specified number of characters starting from a specified position in a string. |
| LCaseStrings | 1 | Returns a string or character converted to lowercase. |
| UCase | 1 | Returns a string or character containing the specified string converted to uppercase. |
| Trim | 1 | Removes all leading and trailing occurrences of a set of characters specified in an array from the current System.String object. |
| ltrim | 1 | Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), Or no leading Or trailing spaces (Trim). |
| InStr | 1 | Returns an integer specifying the start position of the first occurrence of one string within another. |
| AscW | 1 | Returns an Integer value representing the character code corresponding to a character. |
| startsWith | 1 | Does String Start or End With Another String? Determines if entries of x start or end with string (entries of) prefix or suffix respectively, where strings are recycled to c… |
| endsWith | 1 | Does String Start or End With Another String? Determines if entries of x start or end with string (entries of) prefix or suffix respectively, where strings are recycled to c… |
| textLines | 1 | split text to lines |
| makeQGram | 1 | make text index based on the qgram algorithm |
03 Members
Object, String, String)get string between two stack string
this function will get max length string between left and right stack string
| Name | Type | Description |
|---|---|---|
str | Object | - |
left | String | the stack string on the left |
right | String | the stack string on the right |
get tag value string in html
let html_str = "<title>this is title string</title>"; let title_str = html_str |> stack_str(">", "<");
[1] this is title string
print(title_str);
html_str = "<title>this is < title string</title>"; title_str = html_str |> stack_str(">", "<");
[1] this is < title string
print(title_str);
Object, String, String)get between string function is similar to the stack_str function, but this function will get the min length string between two flag
| Name | Type | Description |
|---|---|---|
str | Object | - |
left | String | - |
right | String | - |
get tag value string in html
let html_str = "<title>this is title string</title>"; let title_str = html_str |> between_str(">", "<");
[1] this is title string
print(title_str);
html_str = "<title>this is < title string</title>"; title_str = html_str |> between_str(">", "<");
[1] this is
print(title_str);
String(), Int32, Int32)Returns a string that contains a specified number of characters starting from a specified position in a string.
| Name | Type | Description |
|---|---|---|
strings | String() | Required. String expression from which characters are returned. |
start | Int32 | Required. Integer expression. Starting position of the characters to return. If Start is greater than the number of characters in str, the Mid function returns a zero-length string (""). Start is one based. |
len | Int32 | Optional. Integer expression. Number of characters to return. If omitted or if there are fewer than Length characters in the text (including the character at position Start), all characters from the start position to the end of the string are returned. |
A string that consists of the specified number of characters starting from the specified position in the string.
String())Returns a string or character converted to lowercase.
| Name | Type | Description |
|---|---|---|
strings | String() | Required. Any valid String or Char expression. |
Returns a string or character converted to lowercase.
String())Returns a string or character containing the specified string converted to uppercase.
| Name | Type | Description |
|---|---|---|
strings | String() | Required. Any valid String or Char expression. |
Returns a string or character containing the specified string converted to uppercase.
Removes all leading and trailing occurrences of a set of characters specified in an array from the current System.String object.
| Name | Type | Description |
|---|---|---|
strings | String() | a character vector |
characters | Object | An array of Unicode characters to remove, or null. |
env | Environment | - |
The string that remains after all occurrences of the characters in the trimChars parameter are removed from the start and end of the current string. If trimChars is null or an empty array, white-space characters are removed instead. If no characters can be trimmed from the current instance, the method returns the current instance unchanged.
String())Returns a string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), Or no leading Or trailing spaces (Trim).
| Name | Type | Description |
|---|---|---|
strings | String() | Required. Any valid String expression. |
A string containing a copy of a specified string with no leading spaces (LTrim), no trailing spaces (RTrim), Or no leading Or trailing spaces (Trim).
Returns an integer specifying the start position of the first occurrence of one string within another.
| Name | Type | Description |
|---|---|---|
strings | String() | Required. String expression being searched. |
substr | String() | Required. String expression sought. |
ignoreCase | Boolean | Optional. Specifies the type of string comparison. If Compare is omitted, the Option Compare setting determines the type of comparison. |
envir | Environment | - |
If InStr returns String1 is zero length or Nothing0 String2 is zero length or NothingThe starting position for the search, which defaults to the first character position. String2 is not found0 String2 is found within String1Position where match begins
Object, Environment)Returns an Integer value representing the character code corresponding to a character.
| Name | Type | Description |
|---|---|---|
x | Object | Required. Any valid Char or String expression. If [String] is a String expression, only the first character of the string is used for input. If [String] is Nothing or contains no characters, an System.ArgumentException error occurs. |
envir | Environment | - |
Returns an Integer value representing the character code corresponding to a character.
String(), String, Boolean)Does String Start or End With Another String?
Determines if entries of x start or end with string (entries of) prefix or suffix respectively, where strings are recycled to common lengths.
| Name | Type | Description |
|---|---|---|
x | String() | vector of character string whose |
prefix | String | character vector(often of length one). |
A logical vector, of “common length” of x and prefix (or suffix), i.e., of the longer of the two lengths unless one of them is zero when the result is also of zero length. A shorter input is recycled to the output length.
String(), String)Does String Start or End With Another String?
Determines if entries of x start or end with string (entries of) prefix or suffix respectively, where strings are recycled to common lengths.
| Name | Type | Description |
|---|---|---|
x | String() | vector of character string whose |
suffix | String | character vector(often of length one). |
A logical vector, of “common length” of x and prefix (or suffix), i.e., of the longer of the two lengths unless one of them is zero when the result is also of zero length. A shorter input is recycled to the output length.
String, Boolean, Boolean)split text to lines
| Name | Type | Description |
|---|---|---|
text | String | - |
trim | Boolean | - |
escape | Boolean | - |
Object, Int32)make text index based on the qgram algorithm
| Name | Type | Description |
|---|---|---|
text | Object | - |
qgram | Int32 | - |