Skip to content

Commit

Permalink
Fixed compile error and some typo
Browse files Browse the repository at this point in the history
  • Loading branch information
emrecosar committed Dec 4, 2017
1 parent b1aa255 commit aa37cb0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Write a method to replace all spaces in a string with '%20.' You may assum ethat the string
// has sufficient space at th eend of the string to hold the additional characters, and that you
// Write a method to replace all spaces in a string with '%20.' You may assume that the string
// has sufficient space at the end of the string to hold the additional characters, and that you
// are given the "true" length of the string. (Note: if implementing in Java, please use a characters
// array so that you can perform this operation in place)

public class ReplaceSpaces {
public void replaceSpaces(char[] str, int length) {
int spaceCount = 0, newLength; i;
int spaceCount = 0, newLength;
for(int i = 0; i < length; i++) {
if(str[i] == ' ') {
spaceCount++;
Expand Down

0 comments on commit aa37cb0

Please sign in to comment.