Hi Louis,

<< The text I need to convert is between tags >>

This isn't quite as concise as Allen's but it preserves the original
formatting (i.e. spacing) of the string. To meet your needs I added the
/with refinement.

    proper-case: func [
        "Capitalizes the first letter of each word in the string."
        s [string!]
        /with "specify delimiters other than space and tab."
            delimiters [string! block!]
        /local
            i up-it result
    ][
        if not with [delimiters: " ^-"]
        result: lowercase copy s
        up-it: true
        for i 1 length? result 1 [
            if up-it [
                poke result i to-char uppercase to-string result/:i
                up-it: false
            ]
            if find delimiters result/:i [up-it: true]
        ]
        return result
    ]
    proper-case "gregg irwin"
    proper-case/with "gregg irwin" " "
    proper-case/with ">gregg>irwin" " >"
    proper-case/with ">gregg irwin<" [#" " #"^-" #">"]

HTH!

--Gregg

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to