What is the split method for ionic?

0

Well, I'm developing an app with ionic 3, and I hear of a method called split, but I've never understood its functionality. I just understood that it is related to arrays. Given this:

  • What is the split method?
  • How is it usability?
asked by anonymous 28.11.2018 / 14:45

1 answer

0
  

The split () method splits a String object into an array of strings   separate the string into substrings.

Split is not a unique function of ionic, it is a function of javascript, but it is present in several languages with some variations. It belongs to the object String and will always return an array of strings containing the values separated by the delimiter, equal to explode of php. Example

console.log("Batatinha quando nasce".split(' '))

The expected result is an array with each word separated by spaces.

link

    
28.11.2018 / 17:05