RegEx: Split String at Capitalized Letters and Non-capitalized letters to Create Small Cap Fonts

Posted by Otaku on Stack Overflow See other posts from Stack Overflow or by Otaku
Published on 2010-03-27T06:55:45Z Indexed on 2010/03/27 7:03 UTC
Read the original article Hit count: 450

Filed under:
|
|

So i've purposefully stayed away from RegEx as just looking at it kills me...ugh. But now I need it and could really use some help to do this in .NET (C# or VB.NET). I need to split a string based on capitalization or lack thereof. For example:

I'm not upPercase

  1. "I"
  2. "'m not up"
  3. "P"
  4. "ercase"

or

FBI Agent Winters

  1. "FBI A"
  2. "gent "
  3. "W"
  4. "inters"

The reason I'm doing this is to manually create small caps, in which non-capitalized strings will be sent to uppercase and their font size made 80% of the original font size. Appreciate any help that could be provided here.

© Stack Overflow or respective owner

Related posts about regex

Related posts about .NET