Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

camelCase and snakeCase

using System.Text.RegularExpressions;

public class Program 
{
    public static string ToSnakeCase(string str) 
    {
		    return Regex.Replace(str, "[A-Z]", "_$0").ToLower();
    }
    public static string ToCamelCase(string str) 
    {
			  return  Regex.Replace(str, "_[a-z]", delegate(Match m) {
				    return m.ToString().TrimStart('_').ToUpper();
			  });
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: delete all fields that start with mongo 
Csharp :: triangle calculator 
Csharp :: 2d explosion unity 
Csharp :: how to remove from list from index c# 
Csharp :: how to filter a list in c# 
Csharp :: js if empty then 0 
Csharp :: c# how to return a function 
Csharp :: adding to a dictionary class c# 
Csharp :: how to add object in dictionary in c# 
Csharp :: logical operators in c# 
Csharp :: .net core web api save pdf file in local folder 
Csharp :: dataannotations for currency in c# 
Csharp :: if session is not active then redirect to login page mvc.net 
Csharp :: selecteditem treeview wpf 
Csharp :: nuget package TSETMC guide 
Csharp :: SceneManagment by BuildIndex 
Csharp :: animatro set bool unity 
Csharp :: how to change the color of a single line of code in c# 
Csharp :: visual studio 2019 problem create new .net framework class library 
Csharp :: set ByteArrayContent content type json 
Csharp :: c# UserControl make background transparent 
Csharp :: is list sequential C# 
Csharp :: Zxing Xamarin use front Camera 
Csharp :: writeline in C# 
Csharp :: c# propertyinfo indexof 
Csharp :: Fix Array outside the bonus 
Csharp :: open full screen wpf 
Csharp :: wpf clock conrt 
Csharp :: list.SkipWhile in c# 
Csharp :: unity c# public all codes 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =