added string set function

Implemented 'str_set' as an alternative to 'str_replace' where the input
string is already allocated.