Hello All:
I want to search each element in a string.
I want to count occurances of some elements
and change other elements
;example count every occurance of 'm'
; change every occurance of '+' to ' '
ms: 0
str: "my+name+is+tim"
pairs: 0
forall str
[
if same? first str "m"
[ms: ms+ 1]
if same? first str "+"
[change str #" "]
]
print ["ms: " ms]
str: head str
print str
;The preceding code obviously doesn't work.
what am I doing wrong.
TIA
Tim
