System.Xml.Serialization.CodeIdentifier.MakeCamel C# (CSharp) Method

MakeCamel() public static method

public static MakeCamel ( string identifier ) : string
identifier string
return string
        public static string MakeCamel(string identifier)
        {
            identifier = MakeValid(identifier);
            if (identifier.Length <= 2)
                return CultureInfo.InvariantCulture.TextInfo.ToLower(identifier);
            else if (char.IsUpper(identifier[0]))
                return char.ToLower(identifier[0]) + identifier.Substring(1);
            else
                return identifier;
        }

Usage Example

Example #1
0
 /// <summary>Ensures that the input is of the correct case by modifying the name according to the value of the <see cref="P:System.Xml.Serialization.CodeIdentifiers.UseCamelCasing" /> property. </summary>
 /// <returns>A string that is the same as the input identifier or has the first letter's case modified.</returns>
 /// <param name="identifier">The name to possibly modify.</param>
 public string MakeRightCase(string identifier)
 {
     if (this.UseCamelCasing)
     {
         return(CodeIdentifier.MakeCamel(identifier));
     }
     return(CodeIdentifier.MakePascal(identifier));
 }
All Usage Examples Of System.Xml.Serialization.CodeIdentifier::MakeCamel