String replace using regular expression


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

. must be escaped using \ . It means something in regexp


Copy this code and paste it in your HTML
  1. var pat1:RegExp = /\./gi;
  2. var s:String = "12.345.67.89";
  3. trace(s.replace(pat1,",")) //12,345,67,89

Report this snippet


Comments


You need to login to view comments.