I Believe That The Education And Entertainment Should Be Available For People Who Deserve It.
Wednesday, 22 November 2017
Monday, 6 November 2017
Friday, 3 November 2017
Tuesday, 31 October 2017
Monday, 30 October 2017
Monday, 9 October 2017
Wednesday, 27 September 2017
Java Remove Unnecessary Spaces Within String | Remove Gaps Inside Text |...
{
public static void main(String ar[])
{
String a="This is sparta!";
while(a.contains(" "))
{
a=a.replaceAll(" ","");
}
System.out.println(a);
}
}
Code :- Filename:- RemoveGap.java
class RemoveGap
{
public static void main(String ar[]){
RemoveGap rg=new RemoveGap();
System.out.println(rg.remove("Hello guys this is Unpossible POG"));
}
public String remove(String s)
{
while(s.contains(" "))
{
s=s.replaceAll(" "," ");
}
return s;
}
}
Subscribe to:
Posts (Atom)