Is there an easier way to split CamelCase? Perhaps anything builtin to avoid RegularExpression?
StringJoin[StringSplit["AntiqueWhite and LavenderBlush", RegularExpression["([a-z])([A-Z])"] -> "$1 $2"]]
Out[]= “Antique White and Lavender Blush”
Is there an easier way to split CamelCase? Perhaps anything builtin to avoid RegularExpression?
StringJoin[StringSplit["AntiqueWhite and LavenderBlush", RegularExpression["([a-z])([A-Z])"] -> "$1 $2"]]
Out[]= “Antique White and Lavender Blush”
Well, this certainly works–though it is the same as yours but using a StringExpression instead of a RegularExperssion:
StringReplace["AntiqueWhite and LavenderBlush",
x : CharacterRange["a", "z"] ~~ y : CharacterRange["A", "Z"] :>
x <> " " <> y]
And like yours, it does not check if the new separated words are actually words…