Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 1 KB

join.md

File metadata and controls

63 lines (41 loc) · 1 KB

join

Insert a separator between every character of a string.

API

Numeric.string.join(separator, text)

Inserts a separator between every character.

  • Parameters:
    • separator: Separator placed between characters
    • text: String or array of strings to join
  • Returns: Joined strings matching the input shape
  • NumPy: Equivalent to np.char.join.

Examples

Join the characters of a string

import Numeric from '@neabyte/numerix'

const value = Numeric.string.join('-', 'abc')

console.log(value)
// a-b-c

Join with an empty separator

import Numeric from '@neabyte/numerix'

const value = Numeric.string.join('', 'abc')

console.log(value)
// abc

Join an array of strings

import Numeric from '@neabyte/numerix'

const values = Numeric.string.join('-', ['ab', 'cd'])

console.log(values)
// ["a-b","c-d"]

Join a single character

import Numeric from '@neabyte/numerix'

const value = Numeric.string.join('-', 'a')

console.log(value)
// a