java - Regex to strip Drive letter -


i trying check if there letter followed colon in string.

if so, strip both.

f:/users/mark/ => /users/mark/

this have far:

if(pattern.matches("[a-za-z]:", path))         path = path.substring(2); 

does have better idea on how accomplish this?

you can use:

path = path.replaceall("^[a-za-z]:", ""); 

Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -