Generate Substring From A String In Programming