← All procedures

client.split

Split string by separator

browsernot registered
Package
@procedures/client · README
Path
["client","split"]
CLI
Not a mark command: it is not in the default registry.
As data
{"$proc":["client","split"],"input":{}}
Tags
core, string

Try it in the Composer →

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";

for (const procedure of allCoreProcedures) {
  if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","split"], { value: "<value>", separator: "<separator>" });
console.log(JSON.stringify(result));

As data, in a program

{
  "$proc": ["client", "split"],
  "input": { "value": "<value>", "separator": "<separator>" }
}

Input

FieldTypeRequired
valuestringyes
separatorstringyes
limitnumberno

Output

The schema does not list fields (string[]).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "value": {
        "type": "string",
        "description": "The value"
      },
      "separator": {
        "type": "string",
        "description": "The separator"
      },
      "limit": {
        "description": "The most parts to give",
        "type": "number"
      }
    },
    "required": [
      "value",
      "separator"
    ]
  },
  "output": {
    "type": "array",
    "items": {
      "type": "string"
    },
    "description": "The parts of the string"
  }
}