-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoveWhiteSpaces.java
More file actions
22 lines (17 loc) · 608 Bytes
/
Copy pathRemoveWhiteSpaces.java
File metadata and controls
22 lines (17 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package java_oops;
public class RemoveWhiteSpaces {
public String removeWhiteSpaces(String str){
//Implement your code here and change the return value accordingly
str = str.replace(" ","");
return str;
}
public static void main(String args[]){
String str = "Hello How are you ";
//str = removeWhiteSpaces(str);
System.out.println(str);
RemoveWhiteSpaces object = new RemoveWhiteSpaces();
System.out.println(object.removeWhiteSpaces(str));
String name = "gaurav surnis. from Mysore as of now. namma mysore zindabaaad";
System.out.println(name.replace(" ",""));
}
}