removing words from a string
in
Programming Questions
•
1 year ago
Hi i have been having trouble removing words from a string, i am new to strings..
i have tried using trim()
here is what i thought i could do:
String A = "one,two,three,four,five,six,seven,eight,nine,ten";
String A1 = trim(s,"three"); <--i thought i could define a piece of text to trim,sort of like split() but this throw back an error
println(A1);
i might be barking up the wrong tree but basically i want to delete out the word "three" and leave the rest of the string() as it is.
i thought that i could split the string before and after the word and then join it again, but was wondering if there was a better way.
thanks :)
i have tried using trim()
here is what i thought i could do:
String A = "one,two,three,four,five,six,seven,eight,nine,ten";
String A1 = trim(s,"three"); <--i thought i could define a piece of text to trim,sort of like split() but this throw back an error
println(A1);
i might be barking up the wrong tree but basically i want to delete out the word "three" and leave the rest of the string() as it is.
i thought that i could split the string before and after the word and then join it again, but was wondering if there was a better way.
thanks :)
1