str = str.replace(”find”,”replace”)
To ReplaceAll you have to do it a little differently. To replace all occurrences in the string, use the g modifier like this:
str = str.replace(/find/g,”replace”)
My Knowledges
str = str.replace(”find”,”replace”)
str = str.replace(/find/g,”replace”)
Copyright © 2009 My Knowledges
Design by Design Disease for Smashing Magazine | Blogger Templates by Blog and Web
0 ความคิดเห็น:
แสดงความคิดเห็น