More progress.
Created adapters for invocation services so that I can do inner-class like things by passing references to private functions out to an external entity. I will see if it's possible to merge my adapter with the marshallers because it's still to have multiple wrappy classes. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3944 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -6,5 +6,25 @@ public class StringUtil
|
||||
{
|
||||
return (str == null) || (str.search("\\S") == -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function that strips whitespace from the ends of a String.
|
||||
*/
|
||||
public static function trim (str :String) :String
|
||||
{
|
||||
while (str.search(/\s/) == 0) {
|
||||
str = str.substring(1);
|
||||
}
|
||||
do {
|
||||
var endstr :String = str.substring(str.length - 1);
|
||||
if (endstr.search(/\s/) != -1) {
|
||||
str = str.substring(0, str.length - 1);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user