Solution: str2CapitalWord function does the trick and accomplished the requirement.
input string: "faisal fareed"
output string: "Faisal Fareed"
P.S. There is another function str2Capital which just converts the first letter of the first word e.g. "faisal fareed" will be converted to "Faisal fareed"