Skip to content

Commit

Permalink
hi
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Sep 18, 2024
1 parent 692f613 commit a9fc6ad
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions source/funkin/backend/utils/StringUtils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ class StringUtils
**/
public inline static function formatText(x:String, ?y:String = '-'):String
{
return StringTools.replace(x, y, " ")
.split(" ")
.map(s -> s.charAt(0).toUpperCase() + s.substr(1))
.join(" ");
return StringTools.replace(x, y, " ").capitalize();
}

/**
* Capitalizes Text
* @param x Input
* @return Converted String
**/
public inline static function capitalize(x:String):String
{
return x.split(" ").map(s -> s.charAt(0).toUpperCase() + s.substr(1)).join(" ");
}

/**
Expand Down

0 comments on commit a9fc6ad

Please sign in to comment.