Add isBlank to StringTools for easier blank string checking.
This commit is contained in:
@@ -6,6 +6,18 @@ package funkin.util.tools;
|
||||
@:nullSafety
|
||||
class StringTools
|
||||
{
|
||||
|
||||
/**
|
||||
* Checks if a string is `null` or blank (contains only whitespaces).
|
||||
*
|
||||
* @param value The string to check.
|
||||
* @return True... or False...
|
||||
*/
|
||||
public static function isBlank(value:String):Bool
|
||||
{
|
||||
return value == null || value.trim().length == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string to title case. For example, "hello world" becomes "Hello World".
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user