Lake County .NET Users' Group Helping the .NET developers of Lake County, Illinois

All posts

A function that converts from camel case to a phrase

From Kurt Schroeder:

 

namespace Iknowtek.Utils

{

    public static class GeneralUtilities

    {

        /// <summary>

        /// will insert a space before each capital letter Kurt Schroeder 20080617

        /// Created to deal with enums

        /// example: var str  = GeneralUtilities.SpacedOutCamelCase(   Enum.GetName(typeof(BillingCycle), p.IBillingCycle),1 ));    

 

        /// </summary>

        /// <param name="str"></param>

        /// <param name="idx"></param>

        /// <returns></returns>

        public static string SpacedOutCamelCase(string str, int idx)

        {

            if (idx == str.Length)

                return str;

            if (str[idx].ToString() == str[idx].ToString().ToUpper())

                str = str.Substring(0, ++idx - 1) + " " + str.Substring(idx - 1, (str.Length - idx + 1));

            str = SpacedOutCamelCase(str, ++idx);

            return str;

        }

 

 

    }

}

 

Facebook DZone It! Digg It! StumbleUpon Technorati Del.icio.us NewsVine Reddit Blinklist Furl it!

Comments  99

  • Rosabel 15 Apr, 08:08 PM

    2H0Lkx Good point. I hadn't thoguht about it quite that way. :)
  • yqcegiukwbu 17 Apr, 09:58 AM

    3eVTAl , [url=http://norlmskdmkfe.com/]norlmskdmkfe[/url], [link=http://zmvwxvgbgoct.com/]zmvwxvgbgoct[/link], http://wwpszjqagbyi.com/
  • msenlbmq 24 Apr, 06:56 AM

    bPSO6D , [url=http://apqvmsvtysec.com/]apqvmsvtysec[/url], [link=http://twmwdrtdvmgh.com/]twmwdrtdvmgh[/link], http://odmtnratkhem.com/
  • clonecd950 9 May, 12:05 AM

    As the fool thinks, so the bell clinks.
  • clonecd653 9 May, 12:05 AM

    Every tub must stand on its own bottom.
  • PrivatePilot831 14 May, 05:22 PM

    You may easily play a joke on a man who likes to argue - agree with him.
  • expediacom758 14 May, 06:46 PM

    Early to bed and early to rise makes a man healthy, wealthy and wise.
  • FishOil962 14 May, 08:08 PM

    Man's character is his fate.
  • Watches896 14 May, 09:32 PM

    Delays are dangerous.
  • CodLiverOil767 14 May, 10:54 PM

    Some folks can look so busy doing nothing that they seem indispensable.
  • FishOil124 15 May, 12:18 AM

    Repentance is good, but innocence is better.
  • PrivatePilot392 15 May, 09:31 AM

    Don't have thy cloak to make when it begins to rain.
  • expediacom489 15 May, 10:57 AM

    Either I will find a way, or I will make one.
  • FishOil390 15 May, 12:23 PM

    If some people didn't tell you, you'd never know they'd been away on a vacation.
  • Watches225 15 May, 01:47 PM

    Many a good cow has a bad calf.
  • CodLiverOil395 15 May, 03:11 PM

    What is it: the man only a blunder of God, or God only a blunder of man?
  • FishOil970 15 May, 04:34 PM

    Wives are young men's mistresses, companions for middle age, and old men's nurses.
  • 0294 hot amateur wives 16 May, 03:25 AM

    The only real equality is in the cemetery.
  • 0351 amateur home nudes 16 May, 10:42 PM

    Diplomacy is to do and say the nastiest things in the nicest way.
  • 0884 upskirt amateur pics 17 May, 06:13 AM

    То wash one's dirty linen in public.
  • 0984 real amateur photo 17 May, 07:43 AM

    Our progress as a nation can be no swifter than our progress in education.
  • 0186 amateur real teens 17 May, 09:09 AM

    An empty hand is no lure for a hawk.
  • 0647 nice amateur sex 18 May, 12:43 AM

    A bad workman quarrels with his tools.
  • 0594 amateur porn 18 May, 02:29 AM

    A thief passes for a gentleman when stealing has made him rich.
  • 0982 homemade amateur sex 18 May, 04:17 AM

    Не that goes barefoot must not plant thorns.
  • 0250 hot girlfriend 18 May, 06:21 AM

    Не is a good friend that speaks well of us behind our backs.
  • 0279 my gf get fucked 19 May, 06:14 AM

    We soon believe what we desire.
  • Hello! ggeecea interesting ggeecea site! 2 Jun, 10:34 PM

    Hello! ggeecea interesting ggeecea site!
  • Very nice site! 2 Jun, 10:35 PM

    Very nice site!
  • Strattera Droge 5 Jun, 05:22 PM


    Take it easy. (Relax, calm down).
  • Strattera kann suchtig machen 5 Jun, 11:17 PM


    Believe nothing you hear, and only half of what you see.
  • gunstige propecia 6 Jun, 03:54 AM


    Success breeds success. (People who are successful find it easy to repeat their success).
  • Hello! 9 Jun, 04:44 AM

    Hello!
  • Propecia bestellen 9 Jun, 06:08 PM


    There are no gains without pains.
  • Hello! 7 Jul, 04:01 AM

    Hello!
  • generic 7 Aug, 11:20 PM

    Hello!
  • prada_shoes 7 Aug, 11:23 PM

    Hello!
  • clomid 10 Aug, 04:16 AM

    Hello!
  • ��%2�%0��%2 10 Aug, 05:32 AM

    Hello!
  • hqialtly 3 Sep, 12:17 AM

    hqialtly
  • CLOMIDONLINER 3 Oct, 03:19 AM

    [b]buy clomid 25mg in canada[/b] can men take clomid

    [url=http://discountclomid.webs.com]buy clomid 25mg in canada online without perscription[/url] - clomid endometriosis

    Finally, if a menses is induced, the doctor knows for sure that you are not pregnant. Even if you use the most sensitive home pregnancy test you could still be pregnant with a negative test. Thus having a menstrual period is good reassurance that you are not pregnant and that the lining of the uterus is best prepared for an ovulation and potential pregnancy. Firstly ensure that you are neither overweight or underweight. A healthy body has a BMI of between 18.5 and 24.9. I would advise you to have your BMI checked by your doctor to increase the clomid success rate on first cycle, and wait until your body is in a healthy range before undertaking the first cycle of clomid.
    [b]buy cheap clomid 25mg in canada[/b] [i]pms and clomid[/i]
  • gGxhJLxH 9 Oct, 10:24 PM

    gGxhJLxH
  • HpyRCo 10 Oct, 08:27 AM

    HpyRCo
  • term 14 Oct, 03:47 AM

    Hello!
  • betapace 7 Nov, 09:32 PM

    Hello!
  • amoxil 7 Nov, 09:33 PM

    Hello!
  • cream 7 Nov, 09:33 PM

    Hello!
  • viagra 7 Nov, 09:34 PM

    Hello!
  • generic_viagra 14 Nov, 12:21 PM

    Hello!
  • alavert 14 Nov, 12:21 PM

    Hello!
  • cream 14 Nov, 12:21 PM

    Hello!
  • aleve 14 Nov, 12:21 PM

    Hello!
  • quuahj 22 Nov, 07:42 PM

    quuahj
  • viagra 15 Dec, 09:48 AM

    Hello!
  • XyRscYnTVg 29 Dec, 09:33 AM

    cRZJYH http://www.2KFk8UxzgR3t2CjpiGYlWRZr9NzJwIs8.com
  • gmLmCDzoNAXq 2 Jan, 04:24 PM

    http://www.l4kQDD30zNsyoG7pFkTOj6m6mXdUqdwF.com
  • eFMyfpOKGTl 2 Jan, 05:29 PM

    http://www.NIzi0QxjqKwVZYJ0oEPJhqfCBoLXzubW.com
  • http://shopinq.com/ 15 Jan, 03:00 AM

    NyCwwq comment6
  • free_viagra 16 Jan, 02:33 PM

    Hello!
  • viagra_dosage 16 Jan, 02:34 PM

    Hello!
  • VFAhFIBwZZlQxxGJT 25 Jan, 12:52 PM

    Do you like it here?
  • cheap 29 Jan, 11:25 PM

    Hello!
  • viagra_cheap 29 Jan, 11:25 PM

    Hello!
  • cialis 29 Jan, 11:25 PM

    Hello!
  • viagra_cheap 29 Jan, 11:26 PM

    Hello!
  • fludac 30 Jan, 01:08 AM

    Hello!
  • nexium 30 Jan, 01:09 AM

    Hello!
  • apcalis_sx 30 Jan, 01:09 AM

    Hello!
  • doxazosin 30 Jan, 01:09 AM

    Hello!
  • cymbalta 30 Jan, 01:09 AM

    Hello!
  • ventolin 30 Jan, 01:09 AM

    Hello!
  • furosemide 30 Jan, 01:09 AM

    Hello!
  • compazine 30 Jan, 01:09 AM

    Hello!
  • cleocin 30 Jan, 01:09 AM

    Hello!
  • hydrochlorothiazide 30 Jan, 01:09 AM

    Hello!
  • calan 30 Jan, 01:09 AM

    Hello!
  • crestor 30 Jan, 01:09 AM

    Hello!
  • zaditor 30 Jan, 01:10 AM

    Hello!
  • fincar 30 Jan, 01:10 AM

    Hello!
  • viagra_professional 30 Jan, 01:10 AM

    Hello!
  • chloramphenicol 30 Jan, 01:11 AM

    Hello!
  • online_cialis 30 Jan, 10:31 PM

    Hello!
  • online 30 Jan, 10:31 PM

    Hello!
  • online_cialis 30 Jan, 10:31 PM

    Hello!
  • online 30 Jan, 10:31 PM

    Hello!
  • cialis 1 Feb, 02:54 PM

    Hello!
  • cialis 1 Feb, 02:54 PM

    Hello!
  • viagra 1 Feb, 02:54 PM

    Hello!
  • viagra 1 Feb, 02:54 PM

    Hello!
  • propecia 2 Feb, 03:04 PM

    Hello!
  • accutane 2 Feb, 03:04 PM

    Hello!
  • cialis 2 Feb, 03:04 PM

    Hello!
  • generic_viagra 2 Feb, 03:04 PM

    Hello!
  • cialis 4 Feb, 03:18 AM

    Hello!
  • canadian 4 Feb, 03:18 AM

    Hello!
  • canadian 4 Feb, 03:18 AM

    Hello!
  • canadian 4 Feb, 03:19 AM

    Hello!
  • canadian 4 Feb, 03:19 AM

    Hello!
  • canadian_viagra 4 Feb, 03:20 AM

    Hello!
Post a comment!