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

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

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

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -