Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Latest commit

 

History

History
89 lines (81 loc) · 2.29 KB

substring.md

File metadata and controls

89 lines (81 loc) · 2.29 KB

<-- Go back to README.md

Substring

Returns a specific part of the text based on the provided start and end index.

Placeholder patterns

  • %formatter_text_substring_[start]:[end]_<text>%

Options

Option Description

start

The start index to indicate the beginning of the text.
When no valid number is given will the 0-indexed position of the first String matching start be used.

⚠️ The number is 0-indexed, meaning 0=1, 1=2, etc. ⚠️
Type: Text
Required? No
Conditions:
  • (If number) 0 ≤ x ≤ (text.length() - 1)
Default: 0

end

The end index to indicate the end of the text.
When no valid number is given will the 0-indexed position of the first String matching end be used.
Type: Text
Required? No
Conditions:
  • 0 ≤ x ≤ text.length()
  • start < x
Default: text.length()

text

The text to get the substring from.
Type: String
Required? Yes

Examples

/papi parse me %formatter_text_substring_3:9_Substring%                -> string
/papi parse me %formatter_text_substring_:3_Substring%                 -> Sub
/papi parse me %formatter_text_substring_3:_Substring%                 -> string
/papi parse me %formatter_text_substring_,:_Substring,Another String%  -> ,Another String
/papi parse me %formatter_text_substring_:,_Substring,Another String%  -> Substring