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

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -