remove leading zero from numbers without decimal in R vector

Viewed 1790

Say I have a vector myvec <- c("00890","0891","Apple-20","00-china-usa","0123Belgium"). I want to remove all the zeros before numeric values in this vector and not from alpha-numeric and get the result as shown below.

result

"890", "891", "Apple-20","00-china-usa","0123Belgium"
3 Answers
Related