Is there a scriptcall to capitalize the first letter of each word in a string?

I know if I have "this is a sentance" as variable 9 and I use variable[9].capitalize it will appear as "This is a sentance"

but I want it to appear as "This Is A Sentance"

Thank you in advance.
Why don't you rename the variable to appear with the capital letters?
Try this:
Code:
$game_variables[9].split.map(&:capitalize)*' '
PHP:
$game_variables[9] = String($game_variables[9]).toUpperCase();
// or
var self = $game_variables[9];
self = String(self).toUpperCase();

oups your are with ruby sorry, have not see !
Try this:
Code:
$game_variables[9].split.map(&:capitalize)*' '
Works like a charm, thank you very much!

(Thread can be closed)
For your future threads, when you want it closed please Report your opening post and ask for it to be closed. Mods may not see your post but will see your report.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-scriptcall-to-capitalize-the-first-letter-of-each-word-in-a-string.81771/