Jump to content
UBot Underground

acamso

Fellow UBotter
  • Content Count

    354
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by acamso

  1. Thanks acamso, 

     

    But with regex

    \s+

    you are matching whitespace character which is space, tab, newline, and carriage return

     

    with your function above, all newline and carriage return also will be replace with space right ?

    How to remove extra spaces only, in every line, without removing tab, newline, and carriage return ? 

     

    Yes this function is intended for a string without new lines. I'll make one with new lines included.

  2. 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)}")
            }
        }
    }
    
    
×
×
  • Create New...