|
changeStr
>>-changeStr(needle,newneedle--+--------+--)---------------------------------><
+-,count-+
Returns a copy of the receiver object in which [newneedle] replaces occurrences of [needle] . If [count] is not specified, all occurrences of [needle] are replaced. If [count] is specified, it must be a positive, whole number that gives the maximum number of occurrences to be replaced. Here are some examples: String class - changeStr method
101100~changeStr("1","") -> "000"
101100~changeStr("1","X") -> "X0XX00"
101100~changeStr("1","X",1) -> "X01100"
|