Skip to content
Node: string helpers9 APIs

str

Package str provides lodash/String-style string helpers.

import "github.com/sahilkhaire/gox/str"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions

SymbolNode.jsKindSummary
CamelcamelCase(s)funcCamel converts kebab/snake to camelCase.
Capitalize_.capitalize(s)funcCapitalize uppercases the first rune.
IsBlank!s.trim()funcIsBlank reports whether s is empty or only whitespace.
PadEnds.padEnd(n, ch)funcPadEnd pads s on the right to length with pad (String.padEnd).
PadStarts.padStart(n, ch)funcPadStart pads s on the left to length with pad (String.padStart).
PascalPascalCase(s)funcPascal converts to PascalCase.
Slugslugify(s)funcSlug converts s to a URL-friendly slug.
Snakesnake_case(s)funcSnake converts to snake_case.
Truncate_.truncate(s, n)funcTruncate shortens s to max runes, adding suffix if needed.

MIT Licensed · Built for Node.js developers moving to Go