type.string.truncate
0.000001

Truncates a string.

Arguments
lengthrequired
The maximum length of the truncated string.
Return Value
The string truncated to the given length
something went wrong :(
Truncating a string
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.type.string.truncate.call(
  "foobar", length: 3
)
client.type.string.truncate.call(
  "foobar", {length: 3}
);
curl "https://proc.run/type/string/truncate?length=3" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/json" \
--data '"foobar"'
 

foo


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