Split-2

 

Example of JavaScript split function with regex expression:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <script> var names = 'Visrosoftware ;Ian bell; India ; Chandigarh ;London '; var regexp = /\s*;\s*/; var result= names.split(regexp ); document.write(result); </script> </body> </html>
Output