String Handling Routines: Difference between revisions
imported>Bale mNo edit summary |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
{{Flink|string|to_lower_case|string|desc=Converts all upper-case alphabetic characters to lower-case.}} | {{Flink|string|to_lower_case|string|desc=Converts all upper-case alphabetic characters to lower-case.}} | ||
{{Flink|string|to_upper_case|string|desc=Converts all lower-case alphabetic characters to upper-case.}} | {{Flink|string|to_upper_case|string|desc=Converts all lower-case alphabetic characters to upper-case.}} | ||
{{Flink|string|to_url|location|desc=Returns the url which is accessed to visit the specified location.}} | {{Flink|string|to_url|location|desc=Returns the url which is accessed to visit the specified location.}} | ||
{{Flink|int|extract_meat|string|desc=Returns the number of meat embedded in a string.}} | {{Flink|int|extract_meat|string|desc=Returns the number of meat embedded in a string.}} | ||
{{Flink|int [item]|extract_items|desc=Parses a string for items and their amounts (handles plural & singular forms) and returns the results as a map.}} | {{Flink|int [item]|extract_items|desc=Parses a string for items and their amounts (handles plural & singular forms) and returns the results as a map.}} | ||
{{Flink|int|length|string|desc=Returns the number of characters in the specified string.}} | {{Flink|int|length|string|desc=Returns the number of characters in the specified string.}} | ||
{{Flink| | {{Flink|string|char_at|string|index|desc=Returns the character at a specified index in a string.}} | ||
{{Flink|string|substring|string|int|{{opt|int}}|desc=Returns the substring of the specified string, starting from a specified position, and optionally ending before a specified position (defaults to remainder of string).}} | {{Flink|string|substring|string|int|{{opt|int}}|desc=Returns the substring of the specified string, starting from a specified position, and optionally ending before a specified position (defaults to remainder of string).}} | ||
{{Flink|buffer|replace_string|buffer|string|string}} | {{Flink|buffer|replace_string|buffer|string|string}} | ||
Line 23: | Line 20: | ||
{{Flink|buffer|delete|buffer|int|int|desc=Deletes the specified portion of the buffer.}} | {{Flink|buffer|delete|buffer|int|int|desc=Deletes the specified portion of the buffer.}} | ||
{{Flink|buffer|insert|buffer|int|string|desc=Inserts the string at the specified point in the buffer.}} | {{Flink|buffer|insert|buffer|int|string|desc=Inserts the string at the specified point in the buffer.}} | ||
==Substring Search== | |||
{{FunctionEmbed|contains_text|format=signature|desc=yes}} | |||
{{FunctionEmbed|ends_with|format=signature|desc=yes}} | |||
{{FunctionEmbed|index_of|format=signature|desc=yes}} | |||
{{FunctionEmbed|last_index_of|format=signature|desc=yes}} | |||
{{FunctionEmbed|starts_with|format=signature|desc=yes}} | |||
==Regular Expressions== | ==Regular Expressions== | ||
It is advised that anyone desiring to use these functions should first understand the basics of [[Regular Expressions]] and how these functions implement that language. | It is advised that anyone desiring to use these functions should first understand the basics of [[Regular Expressions]] and how these functions implement that language. | ||
{{Flink|matcher|create_matcher|string|string|desc=Creates a matcher from a pattern and input string.}} | {{Flink|matcher|create_matcher|string|string|desc=Creates a matcher from a pattern and input string.}} |
Latest revision as of 12:43, 23 December 2020
Simple
string to_lower_case( string )
string to_upper_case( string )
string to_url( location )
int [item] extract_items()
int length( string )
string char_at( string, index )
string substring( string, int, [int] )
buffer replace_string( buffer, string, string )
buffer replace_string( string, string, string )
buffer replace( buffer, int, int, string )
string url_encode( string )
string url_decode( string )
string [int] split_string( string, [string] )
string [int] session_logs( [string], int )
buffer append( buffer, string )
void set_length( buffer, int )
buffer delete( buffer, int, int )
buffer insert( buffer, int, string )
Substring Search
boolean contains_text( string, string )
- Returns true if the first string contains the second string.
boolean ends_with( string, string )
- Checks whether a string ends with a suffix string. (case-sensitive)
int index_of( string, string, int? )
- Returns the position of the second string in the first (or -1 if not found), optionally starting its search from a given position.
int last_index_of( string, string, int? )
- Returns the last index of the second string in the first, or -1 if no match is found.
boolean starts_with( string, string )
- Checks whether a string starts with a prefix string. (case-sensitive)
Regular Expressions
It is advised that anyone desiring to use these functions should first understand the basics of Regular Expressions and how these functions implement that language.
matcher create_matcher( string, string )
matcher reset( matcher, [string] )
string [int,int] group_string( string, string )
boolean find( matcher )
string group( matcher, [int] )
string replace_all( matcher, string )
string replace_first( matcher, string )
buffer append_replacement( matcher, buffer, string )
buffer append_tail( matcher, buffer )