String Manipulation Functions #21
-
I think a Here are string manipulation functions that are available in the programming languages that underlay the various popular JMESPath implementations:
Note that JMESPath already implements the following string manipulation functions:
We plan to propose expanding slices to operate on string types. Please, note that JMESPath already implements SpecificationSome string manipulation functions bring the new concept of optional arguments to JMESPath functions. The specification paragraph on function evaluation must thus be changed accordingly – highlighted in bold in the text below: Functions can References |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 8 replies
-
Some additional functions:
An alternative to pad_*, upper, lower, and title could be a format() function that takes a format string with various formatting codes / syntax that include these manipulations. I think the Python format string syntax is worth adopting. It allows for parametrization of the placeholders within the format string. This opens the doors to extensibility over creating additional string manipulation functions.. |
Beta Was this translation helpful? Give feedback.
-
This is a JEP fragment that specifies the Specificationlower
Returns the lowercase Examples
upper
Returns the uppercase
HistoryN/A |
Beta Was this translation helpful? Give feedback.
-
This is a JEP fragment that specifies the Specificationtrim
Given the The Examples
trim_left
Given the Like for the Examples
trim_right
Given the Like for the Examples
HistoryN/A |
Beta Was this translation helpful? Give feedback.
-
This is a JEP fragment that specifies the Specificationreplace
Given the The The Examples
HistoryN/A |
Beta Was this translation helpful? Give feedback.
-
This is a JEP fragment that specifies the Specificationpad_left
Given the The The Examples
pad_right
Given the The The Examples
History
|
Beta Was this translation helpful? Give feedback.
-
This is a JEP fragment that specifies the Specificationfind_first
Given the The
Examples
find_last
Given the The If this parameter is omitted, It defaults to
HistoryN/A |
Beta Was this translation helpful? Give feedback.
-
This is a JEP fragment that specifies the Specificationsplit
Given string The The If Otherwise, the Examples
History
|
Beta Was this translation helpful? Give feedback.
-
The string manipulation functions are supported in the preview page. |
Beta Was this translation helpful? Give feedback.
-
String Functions
AbstractThis JEP introduces a core set of useful string manipulation functions. Those functions are modeled from functions found in popular programming languages such as JavaScript and Python. Specificationfind_first
Given the The
Contrary to similar functions found in most popular programming languages, the Examples
find_last
Given the The If this parameter is omitted, It defaults to Likewise, the
lower
Returns the lowercase Examples
pad_left
Given the The The Examples
pad_right
Given the The The Examples
replace
Given the The The Examples
split
Given string The The If Otherwise, the Note: The Examples
Specificationtrim
Given the The Examples
trim_left
Given the Like for the Examples
trim_right
Given the Like for the Examples
upper
Returns the uppercase
ComplianceA new |
Beta Was this translation helpful? Give feedback.
-
Thanks for the proposal @springcomp. Can we also add a For example, the lower case of // this is Javascript
'ß'.toLowerCase() == 'ss'.toLowerCase() // this is false
'ß'.localeCompare('ss', undefined, { sensitivity: 'base' }) // this is 0, they are the same with case insensitive comparison |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
I propose to add a regex operator, to allow to use the power of regex: Match operatorGiven the
|
Beta Was this translation helpful? Give feedback.
String Functions
Abstract
This JEP introduces a core set of useful string manipulation functions. Those functions are modeled from functions found in popular programming languages such as JavaScript and Python.
Specification
find_first
Given the
$subject
string,find_first()
returns the index of the first occurence where the$sub
substring appears in$subject
ornull
.The
$start
and$end
parameters are optional and allow to select wherefind_first()
must perform its …