Skip to content

startsWith

String.startsWith(target, source)

Checks if target string starts with source string.

Example

ts
import { String } from "@monstermann/string";

String.startsWith("hello world", "hello"); // true
String.startsWith("hello world", "world"); // false
ts
import { String } from "@monstermann/string";

pipe("hello world", String.startsWith("hello")); // true
pipe("hello world", String.startsWith("world")); // false