Replace white space in a string with \"-\"

/ Published in: ActionScript 3
Save to your folder(s)

Replace "-" with anything you want to. Useful for amending URLs.

Copy this code and paste it in your HTML
  1. yourString = yourString.replace(/\s+/g, '-');


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.