Replace slash and backslash to make sure the result is not a file path.

This commit is contained in:
Reinhard Pointner 2016-05-04 23:27:49 +08:00
parent 38d4e7c250
commit 0acd0e885a
1 changed files with 9 additions and 0 deletions

View File

@ -146,6 +146,15 @@ public class ExpressionFormatMethods {
return compile("\\s*[:]\\s*", UNICODE_CHARACTER_CLASS).matcher(self).replaceAll(replacement);
}
/**
* Replace slash and backslash to make sure the result is not a file path.
*
* e.g. "V_MPEG4/ISO/AVC" -> "V_MPEG4.ISO.AVC"
*/
public static String slash(String self, String replacement) {
return compile("\\s*[\\\\/]+\\s*", UNICODE_CHARACTER_CLASS).matcher(self).replaceAll(replacement);
}
/**
* Upper-case all initials.
*