Utility functions for working with text.
import { toCamelCase, compareSimilarity } from "@std/text";import { assertEquals } from "@std/assert";assertEquals(toCamelCase("snake_case"), "snakeCase");const words = ["hi", "help", "hello"];// Words most similar to "hep" will be at the frontassertEquals(words.sort(compareSimilarity("hep")), ["help", "hi", "hello"]); Copy
import { toCamelCase, compareSimilarity } from "@std/text";import { assertEquals } from "@std/assert";assertEquals(toCamelCase("snake_case"), "snakeCase");const words = ["hi", "help", "hello"];// Words most similar to "hep" will be at the frontassertEquals(words.sort(compareSimilarity("hep")), ["help", "hi", "hello"]);
Utility functions for working with text.