silver-hands / sss

0 stars 0 forks source link

【Q086】面试题05. 替换空格 #86

Open fly0o0 opened 4 years ago

fly0o0 commented 4 years ago

面试题05. 替换空格

fly0o0 commented 4 years ago
/**
 * @param {string} s
 * @return {string}
 */
var replaceSpace = function(s) {
  return s.replace(/\s/g, '%20');
};