To remove the unnecessary left spaces in the beginning of the word ,also known as left trimming of the word.
Java provides the built in method to left trim the word . But here we are writing the code without using the built in method of java .
for example :
If the user inputs a string like this : " Alive is awesome" , then the result will remove the spaces before the first character of the word .
So the answer will be : "Alive is awesome"
Demo :
Java provides the built in method to left trim the word . But here we are writing the code without using the built in method of java .
for example :
If the user inputs a string like this : " Alive is awesome" , then the result will remove the spaces before the first character of the word .
So the answer will be : "Alive is awesome"
Demo :