// ==================================================
// Title: Splitting Text with RegExp
// ==================================================
//
// split() accepts a regular expression.
//
// This example splits on commas and whitespace.
//
const input: string =
"apple, banana, orange, grape";
const separator: RegExp = /,\s*/;
const fruits: string[] =
input.split(separator);
console.log(fruits);
/*
run:
[ 'apple', 'banana', 'orange', 'grape' ]
*/