* trim spaces characters properly

This commit is contained in:
Reinhard Pointner 2012-02-16 02:42:27 +00:00
parent f1c2b9fe91
commit 2fa9b625fa
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ String.metaClass.replaceAll = { String pattern -> replaceAll(pattern, "") }
*
* e.g. "Doctor Who" -> "Doctor_Who"
*/
String.metaClass.space = { replacement -> replaceAll(/[:?._\s]+/, replacement) }
String.metaClass.space = { replacement -> replaceAll(/[:?._]/, " ").trim().replaceAll(/\s+/, replacement) }
/**