Remove the blank space to a resulting string

-1

Hi, I have this question:

Delete the blank spaces of a string that is entered by keyboard. The result it must be in another chain. You can not use replace methods.

    
asked by Jose Alvarez 13.12.2018 в 12:44
source

1 answer

0

You must use a for loop, create a new string and concatenate character by character in that new string (you must first initialize it eg result = "" .) Then check each character with a cadenaoriginal.charAt(i) [i=contador del bucle for]) , if the character is equal to a blank space, omit and go to the next string, if it is not equal to space then concatenates the character to the resulting new string.

    
answered by 13.12.2018 / 13:00
source