Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extensions README.md formatting #345

Merged
1 commit merged into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions extensions/src/main/java/dev/cel/extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ zero-based.
Returns the character at the given position. If the position is negative, or greater than
the length of the string, the function will produce an error.

<string>.charAt(<int>) -> <string>
<string>.charAt(<int>) -> <string>

Examples:

'hello'.charAt(4) // return 'o'
'hello'.charAt(5) // return ''
'hello'.charAt(-1) // error
'hello'.charAt(4) // return 'o'
'hello'.charAt(5) // return ''
'hello'.charAt(-1) // error

### IndexOf

Expand All @@ -156,33 +156,33 @@ not found the function returns -1.
The function also accepts an optional offset from which to begin the substring search. If the
substring is the empty string, the index where the search starts is returned (zero or custom).

<string>.indexOf(<string>) -> <int>
<string>.indexOf(<string>, <int>) -> <int>
<string>.indexOf(<string>) -> <int>
<string>.indexOf(<string>, <int>) -> <int>

Examples:

'hello mellow'.indexOf('') // returns 0
'hello mellow'.indexOf('ello') // returns 1
'hello mellow'.indexOf('jello') // returns -1
'hello mellow'.indexOf('', 2) // returns 2
'hello mellow'.indexOf('ello', 2) // returns 7
'hello mellow'.indexOf('ello', 20) // error
'hello mellow'.indexOf('') // returns 0
'hello mellow'.indexOf('ello') // returns 1
'hello mellow'.indexOf('jello') // returns -1
'hello mellow'.indexOf('', 2) // returns 2
'hello mellow'.indexOf('ello', 2) // returns 7
'hello mellow'.indexOf('ello', 20) // error

### Join

Returns a new string where the elements of string list are concatenated.

The function also accepts an optional separator which is placed between elements in the resulting string.

<list<string>>.join() -> <string>
<list<string>>.join(<string>) -> <string>
<list<string>>.join() -> <string>
<list<string>>.join(<string>) -> <string>

Examples:

['hello', 'mellow'].join() // returns 'hellomellow'
['hello', 'mellow'].join(' ') // returns 'hello mellow'
[].join() // returns ''
[].join('/') // returns ''
['hello', 'mellow'].join() // returns 'hellomellow'
['hello', 'mellow'].join(' ') // returns 'hello mellow'
[].join() // returns ''
[].join('/') // returns ''

### LastIndexOf

Expand Down Expand Up @@ -304,8 +304,8 @@ ASCII range.

Examples:

'TacoCat'.upperAscii() // returns 'TACOCAT'
'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII'
'TacoCat'.upperAscii() // returns 'TACOCAT'
'TacoCÆt Xii'.upperAscii() // returns 'TACOCÆT XII'

## Encoders

Expand Down
Loading