We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54fe43d commit e86a97dCopy full SHA for e86a97d
src/main/java/com/rampatra/strings/RemoveExtraSpaces.java
@@ -49,7 +49,10 @@ public static String removeExtraSpaces(String s) {
49
}
50
51
52
- return String.valueOf(Arrays.copyOf(c, j));
+ String stringAfterRemove = String.valueOf(Arrays.copyOf(c, j));
53
+ //Remove Extra Space at the beginning and the end
54
+ String removeBegAndEnd = stringAfterRemove.trim();
55
+ return removeBegAndEnd;
56
57
58
public static void main(String[] args) {
0 commit comments