regex - Removing zeros in betwenn a string in java -
i want remove zeros in string.
for example,
string = ay000120
then output should
ay120
so thing between ay , next number greater 0 should removed. also, if 0 occurs after number greater 1 0 not deleted.
a reg ex useful.
replace ^(ay)0*([1-9].*)
by \1\2
or, if knew input in fixed format ay+(zero or more 0)+(other numbers)
, can just:
replace ^ay0*
ay
Comments
Post a Comment