Onetastic Macro Documentation >
>
>
String_Substring String_Substring
Returns a part of the given string. The part starts from the 0-based offset and the length of it is count.
Syntax
String String_Substring(
String string,
Numeric offset,
Numeric count)
Parameters
- String string
- String to return the part of.
- Numeric offset
- 0-based start index of the substring. If non-negative, the substring will start this number of characters counted from the beginning of the string. If negative, the substring will start this number of characters counted from the end of the string.
- Numeric count
- Length of the substring.
Examples
$substring = String_Substring("The quick brown fox", 5, 7)
$substring = String_Substring("The quick brown fox", -8, 4)
$substring = String_Substring("The quick brown fox", 0, 10)
$substring = String_Substring("The quick brown fox", -5, 5)
|