<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - warwick-datum-process</title>
<link>http://snipplr.com/users/warwick-datum-process</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Fri, 24 May 2013 07:12:37 GMT</pubDate>
<item>
<title>(Visual Basic) Splitting the words in a  TitleCase string without using regular expressions (for VBA)</title>
<link>http://snipplr.com/view/65842/splitting-the-words-in-a--titlecase-string-without-using-regular-expressions-for-vba/</link>
<description><![CDATA[ <p>Using VBA (Visual Basic for Applications) in MS Access, I needed to convert TitleCase to lower\_case, but did not have the regex enqine that's available in VB Script.  This solution,  based on a simple state machine model, splits the words in the string (converting to lower-case is trivial after that).  It treats a block of upper-case letters as a single word, but the last letter of that block is the first letter of the next word; e.g., "VBAIsLame" becomes "VBA Is Lame".   Because of this behaviour, if you subsequently convert to lower-case, you cannot reliably convert back to the original (all-upper-case words are indistinguishable from title-case words).  To resolve this potential ambiguity, you can supply an "upper\_case\_indicator" that will be inserted before each capital letter that isn't the start of a word.  So `TitleCaseSplit("VBAIsLame", "_", "-")` returns "V-B-A\_Is\_Lame".</p> ]]></description>
<pubDate>Thu, 28 Jun 2012 03:16:13 GMT</pubDate>
<guid>http://snipplr.com/view/65842/splitting-the-words-in-a--titlecase-string-without-using-regular-expressions-for-vba/</guid>
</item>
</channel>
</rss>