typescriptUpdated about 2 months ago

Convert string space

by @Apiwit

typescript
export function convertStringSpace(
  text?: string,
  separator = "-",
  newSeparator = " "
) {
  if (!text) return "";
  return String(text).replace(separator, newSeparator);
}

Description

Convert string separator to another separator.

Comments