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
Post a Comment