added string function with return

added the string function with return variable