Java Reference
In-Depth Information
figureĀ 6-1
Remember from Chapter 5 that the join() method converts an array into a string, separating each
element with the specified separator.
Finally, you display the new string in an alert box:
alert(reversedString);
}
After you've looked at regular expressions, you'll revisit the split() method.
the replace() method
The replace() method searches a string for occurrences of a substring. Where it finds a match for
this substring, it replaces the substring with a third string that you specify.
Let's look at an example. Say you have a string with the word May in it, as shown in the
following:
var myString = "The event will be in May, the 21st of June";
 
Search WWH ::




Custom Search