forked from as3/as3-utils
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathreplace.as
More file actions
27 lines (27 loc) · 826 Bytes
/
replace.as
File metadata and controls
27 lines (27 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package utils.string
{
/**
* Replaces all instances of the replace string in the input string
* with the replaceWith string.
*
* @param input The string that instances of replace string will be
* replaces with removeWith string.
*
* @param replace The string that will be replaced by instances of
* the replaceWith string.
*
* @param replaceWith The string that will replace instances of replace
* string.
*
* @returns A new String with the replace string replaced with the
* replaceWith string.
*
* @langversion ActionScript 3.0
* @playerversion Flash 9.0
* @tiptext
*/
public function replace(input:String, replace:String, replaceWith:String):String
{
return input.split(replace).join(replaceWith);
}
}