type.string.split
0.000001

Splits a string into parts.

Arguments
separatorrequired
The separator used to split the given string.
limit
The maximum number of parts to split the string into.
Return Value
An array of strings.
something went wrong :(
Splitting a string into parts
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.type.string.split.call(
  "foo:bar:baz", separator: ":", limit: 2
)
client.type.string.split.call(
  "foo:bar:baz", {separator: ":", limit: 2}
);
curl "https://proc.run/type/string/split?separator=%3A&limit=2" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "foo:bar:baz"
 

["foo", "bar:baz"]


Stuck? Want to chat about an idea? Join the community on Discord.