hi guys, need help here.
I want to remove whitespace in a string without built-in function. I think about using a loop. Then I get stuck.
The logic is :
- loop the string
- if the string != ’ ':
- print string[i+1:]
This is the sample code:
string = ’ I love Aru ’
temp = ‘’
for i in range(len(string)):
if string[i] != ’ ':
break
temp = string[i+1:]
print(temp)
…it’s not finished