1) We should write Str_Explode/Str_Split function, splitting string into substrings by string separator.
Str_Replace is implemented via Str_Explode('....', '108') + Array_Join(..., '52')
2) We have to implement string replacement function manually or via dll.