Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Use this regex (I forgot from which stackoverflow answer I sourced it, will search it now):</p> <pre><code> public static string ToLowercaseNamingConvention(this string s, bool toLowercase) { if (toLowercase) { var r = new Regex(@" (?&lt;=[A-Z])(?=[A-Z][a-z]) | (?&lt;=[^A-Z])(?=[A-Z]) | (?&lt;=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace); return r.Replace(s, "_").ToLower(); } else return s; } </code></pre> <p>I use it in this project: <a href="http://www.ienablemuch.com/2010/12/intelligent-brownfield-mapping-system.html" rel="noreferrer">http://www.ienablemuch.com/2010/12/intelligent-brownfield-mapping-system.html</a></p> <p><strong>[EDIT]</strong></p> <p>I found it now: <a href="https://stackoverflow.com/questions/2559759/how-do-i-convert-camelcase-into-human-readable-names-in-java">How do I convert CamelCase into human-readable names in Java?</a></p> <p>Nicely split "TodayILiveInTheUSAWithSimon", no space on front of " Today":</p> <pre><code>using System; using System.Text.RegularExpressions; namespace TestSplit { class MainClass { public static void Main (string[] args) { Console.WriteLine ("Hello World!"); var r = new Regex(@" (?&lt;=[A-Z])(?=[A-Z][a-z]) | (?&lt;=[^A-Z])(?=[A-Z]) | (?&lt;=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace); string s = "TodayILiveInTheUSAWithSimon"; Console.WriteLine( "YYY{0}ZZZ", r.Replace(s, " ")); } } } </code></pre> <p>Output: </p> <pre><code> YYYToday I Live In The USA With SimonZZZ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload