Regex or the like to capitalize names?

#1

Can someone show me an example of a regex or script to capitalize single words?

(Karen Barker) #2

Hi there,

You can actually use the Text service to capitalise words within Flow XO.

Alternatively if you are trying to use the code service here you could do something like the following:

var a = "hello";

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

resolve (capitalizeFirstLetter(a));

Hope this helps :slight_smile:

1 Like