We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So I need to remove a certain number (the number 0) from a string with, I thought I should split the string up and then look at each number separated at which point I would replace ever 0 with a one but I've got no clue on how to actual put this in code.
Answers
Take a look at String's many methods so you can figure out the best approach to tackle your problem:
https://www.javatpoint.com/java-string-replaceall
@schotsl -- It wasn't clear to me whether you want to do this:
or instead this:
there are many ways to do these things. Here is one way using built in Processing functions:
Split your string by 0s, then join the segments together with nothing:
or, more concisely:
This works for replacing "0" with nothing, or with something, like "1":
For the reference, see:
Thnx to you all! I got it working now