STRING EXTRACTION/TRUNCATE from a given character in java -


hi doing ui project in java. truncate string or sequence of character given string example: if 000101 user input output of string 101. p.s: occurrence of 0's before 1 may anything.

please me!!

i'm sure there many ways this, , encourage figure out way on own.

here's 1 answer question:

why not try take user input , keep cutting off first character of string until reach nonzero number?

for example, let's have string called "userinput".

while(userinput.substring(0,1).equals("0"))     userinput = userinput.substring(1); 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -