如果我有字符串像數組:什麼是最優雅的方式來使這種字符串數組更改?
var myStrArr=['book-in-my-house',
'chair-in-my-house',
'bed-in-my-house',
'TV-in-my-house'];
我想改變myStrArr到herStrArr,如:
var herStrArr=['book-in-her-house',
'chair-in-her-house',
'bed-in-her-house',
'TV-in-her-house'];
正如您上面所看到的,改變每「my
」在每個字符串「her
」。 在JavaScript中進行此更改的最優雅方式是什麼?
如何關於刪除所有「我的」構建strArr? – Leem 2011-06-08 10:27:40