Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Enzo Cioppettini
ion
Commits
0159ed3e
Commit
0159ed3e
authored
7 years ago
by
Agustin Chiappe Berrini
Browse files
Options
Downloads
Patches
Plain Diff
Add `split_at` at manual
parent
26af2f91
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
manual/src/ch05-05-method.md
+23
-0
23 additions, 0 deletions
manual/src/ch05-05-method.md
with
23 additions
and
0 deletions
manual/src/ch05-05-method.md
+
23
−
0
View file @
0159ed3e
...
...
@@ -456,6 +456,7 @@ echo $unescape($line)
The following are the currently-supported array methods.
-
[
split
](
#split
)
-
[
split_at
](
#split_at
)
-
[
bytes
](
#bytes
)
-
[
chars
](
#chars
)
-
[
graphemes
](
#graphemes
)
...
...
@@ -489,6 +490,28 @@ age
data
```
### split_at
Defaults to string variables. The supplied string will be split in two pieces, from the index specified in the second argument.
#### Examples
```
echo @split_at("FOOBAR", "3")
echo @split_at("FOOBAR")
echo @split_at("FOOBAR", "-1")
echo @split_at("FOOBAR", "8")
```
#### Output
```
FOO BAR
ion: split_at: requires an argument
ion: split_at: requires a valid number as an argument
ion: split_at: value is out of bounds
```
### bytes
Defaults to string variables. Returns an array where the given input string is split by bytes and
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment