Link Search Menu Expand Document

Match Whitespace

Summary

  • \s can be used to search for whitespace.

Final Code

let sample = "Whitespace is important in separating words";
let countWhiteSpace = /\s/gi; // Change this line
let result = sample.match(countWhiteSpace);