Add isBlank to StringTools for easier blank string checking.

This commit is contained in:
ImVeryBad
2026-03-13 21:25:52 -06:00
committed by Hundrec
parent 15bef89d71
commit dca54de087
+12
View File
@@ -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".
*