Strings
`breads.strings`
Function: sarcastic. Return string with sArCaStIc words.
sarcastic. Return string with sArCaStIc words.function sarcastic(string: string): string;Example:
const sarcastic = require("103-breads").strings.sarcastic;
console.log(sarcastic("Hello")); // hElLoFunction: separation. Returns separated string.
separation. Returns separated string.function separation(string: string, uppercase?: boolean): string;Example:
const separation = require("103-breads").strings.separation;
console.log(separation("abc")); // a b c
console.log(separation("abc", true)); // A B CFunction: includesAll. Check if a string includes all members of an array.
includesAll. Check if a string includes all members of an array.function includesAll(string: string, matches: string[]): boolean;Example:
const includesAll = require("103-breads").strings.includesAll;
console.log(includesAll("Hello world!", ["world", "javascript"])); // true
console.log(includesAll("Hello world!", ["javascript"])); // falseFunction: includesSome. Check if a string includes one of the strings included.
includesSome. Check if a string includes one of the strings included.function includesSome(string: string, matches: string[]): boolean;Example:
const includesSome = require("103-breads").strings.includesSome;
console.log(includesSome("Hello world!", ["world", "javascript"])); // true
console.log(includesSome("Hello world!", ["javascript"])); // falseLast updated
Was this helpful?