Jump to content
UBot Underground

Ubot Studio Tutorial: Capitalize First Letter Of String (Function)


Recommended Posts

  • 4 months later...

Happen to have a script example?

 

Here is a Python example...

set(#your string,"this is a string that needs first letter capitalized.","Global")
alert($python result("","string = \'{#your string}\'

string.capitalize()"))

Regards,

CD

Link to post
Share on other sites
  • 3 weeks later...

Happen to have a script example?

comment("WITH WHITESPACE")
alert($acamso capitalize first letter("      hellow", $true))
comment("WITHPOUT WHITESPACE")
alert($acamso capitalize first letter("      hellow", $false))
divider
define $acamso capitalize first letter(#text, #whitespace) {
    if($comparison(#whitespace,"=",$true)) {
        then {
            return("{$change text casing($find regular expression(#text,"^(\\s+|)\\w"),"Upper Case")}{$replace regular expression(#text,"^(\\s+|)\\w",$nothing)}")
        }
        else {
            return("{$change text casing($find regular expression($replace regular expression(#text,"^\\s+",$nothing),"^\\w"),"Upper Case")}{$replace regular expression(#text,"^(\\s+|)\\w",$nothing)}")
        }
    }
}

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...