Unverified Commit 59dfa943 authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Create Remove white spaces from string

parent 2a5b0f23
String modify(String S)
{
// your code here
String w = "";
int l = S.length();
for(int i =0; i<l;i++)
{
char ch = S.charAt(i);
if(ch!=' ')
{
w = w + ch;
}
else
{
ch = ch++;
}
}
return w;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment