How to create a [
Reusable] Function in [
C#.NET]
Making a reusable function allows you to use the function anywhere within your code project.
I first created an identical function for ASP Classic and needed something similar in ASP.net.
To use in your asp.net C# project, simply copy the above code and paste it into your project, replacing only the string characters you need to replace in your project.
To reuse this function, do the following
The above example will
#1: replace the Parentheses with {
curly brackets} and add underscores where spaces are at.
Output: Test_{This_is_a_test}
#2: replace the {
curly brackets} with Parentheses and remove the underscores.
Output: Test (This is a test);