Previous Code Entry
Left Arrow
ASP.NET Column & Paging System with VB.NET
Current Code Entry
Go Back To Code List
[VB.NET]
ASP.NET - How to create a Reusable Replace Function in VB.NET
Article Entry Date: April 18,2024 @ 03:17:40 / Last Updated On: April 18,2024 @ 03:56:26
How to create a [Reusable] Function in [VB.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 VB 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);

Other Articles Related to this Entry.

ASP.NET - How to create a Reusable Replace Function in C#.NET«
ASP Classic - How to create a Reusable Replace Function«