Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
Wessel T edited this page Jan 24, 2019 · 1 revision

String utilities

nabbit.cramp(str): String

  • str (String) - The string to cramp together

Remove all spaces from str

nabbit.cramp( 'H e l l o' )
// => Hello

nabbit.mock(str): String

  • str (String) - The string to mock

Transform str to have random capital letters

nabbit.mock( 'Hello' )
// => HeLlO

nabbit.reverse(str): String

  • str (String) - The string to reverse

Reverse str

nabbit.reverse( 'Hello' )
// => olleH

nabbit.space(str): String

  • str (String) - The string to space out

Space out all characters from str

nabbit.space( 'Hello' )
// => H e l l o

nabbit.string(length, seed): String

  • length (Number) - The length of the string
  • seed (String) - The seed to use

Generate a random string using a specified length and seed

nabbit.string( 8 )
// => NtJcuDzA

nabbit.string( 4, 'ab' )
// => abba

nabbit.replaceCharAt(str, index, char): String

  • str (String) - The original string
  • index (Number) - The index of the character to replace
  • char (String) - The replacement character

Replace the character from str at index with char

nabbit.replaceCharAt( 'Hello', 2, 'o' )
// => Heolo

Clone this wiki locally