Thanks sir, that was helpful but in my case "SO" is not constant it will change, I will add few example here
RAJ I# POW HE## -> (expected answer) RAJ
KUMAR TEJAS# -> KUMAR
I have to find the string contains '#' if it contains then I have to print character before the space. Ignore the lettters attach to '#'.