How to Convert Comma Separated String into an Array in JavaScript
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Use the
split()
MethodYou can use the JavaScript
split()
method to split a string using a specific separator such as comma (,
), space, etc. If separator is an empty string, the string is converted to an array of characters.The following example demonstrates how to convert a comma separated string of person name into an array and retrieve the individual name using JavaScript.
need an explanation for this answer? contact us directly to get an explanation for this answer