Monday, June 23, 2025 14:57

Posts Tagged ‘regex’

Replacing a string inside another string

Friday, April 21st, 2017

Whenever you want to replace a string inside another string, .NET Framework offers the Replace() function. It is a function that accepts two string parameters, the string to be replaced and the string to replace with. Its usage is very simple:

using System;

namespace HelloWorld
{
    class Program
    {
        private static void Main(string[] args)
        {
            string greeting = "Hello World!";
Read more