To Camel Case - CSharp System

CSharp examples for System:String Case

Description

To Camel Case

Demo Code


using JetBrains.Annotations;

public class Main{
        [NotNull]//from   w w  w .  j a  va2s .  c o m
        public static string ToCamelCase([NotNull] this string memberTypePascalCase)
        {
            Guard.NotNull(memberTypePascalCase, nameof(memberTypePascalCase));

            return memberTypePascalCase.Length > 1
                ? memberTypePascalCase.Substring(0, 1).ToLowerInvariant() + memberTypePascalCase.Substring(1)
                : memberTypePascalCase;
        }
}

Related Tutorials