Write a method stringSpace that takes a string s and returns s, spaced out:
- Call: stringSpace(“Hello”);
- Return value: H e l l o
Adapt your code so that the method takes a string s and an int n so that it returns s spaced out with n spaces:
- Call: stringSpace(“Hello”, 3);
- Return value: H e l l o
Adapt your code so that the method now takes a string s, an int n and a string c so that it returns s spaces out with n instances of c:
- Call: stringSpace(“Hello”, 2, “*”);
- Return value: H**e**l**l**o
Write a method stringReverse that takes a string s and returns s reversed:
- Call: stringReverse(“Hello”);
- Return value: olleH