string operations

string relateed algorithm
update code

Implement new function to operate strings.