View/Edit #29:properly_capitalize

Switch to edit mode.

Name(s): properly_capitalize
1:  {string, ?non_capitalized = {"to", "for", "of", "a", "with"}} = args
2:  words = $su:words(string)
3:  out = {}
4:  for x in [1..length(words)]
5:    if (x != 1 && words[x] in non_capitalized)
6:      out = {@out, words[x]}
7:    else
8:      out = {@out, $su:capitalize(words[x])}
9:    endif
10: endfor
11: return $su:from_list(out, " ")

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Lao-Tzu (#8084)

You are not logged in.

[home | help | who | search | setup | code]