48
1
// Author : Tech Point Fundamentals
2
// Website : www.techpointfunda.com
3
// Channel : https://www.youtube.com/c/TechPointFundamentals
4
// Question : How can you find and remove the special characters from a string? Write a program to remove the special characters from a string.
5
// Demo : Removing Special Characters
6
7
using System;
8
using System.Text.RegularExpressions;
9
using System.Text;
10
11
public class Program
12
{
13
public static void Main()
14
{
15
string inputString = "www.techpointfunda.com";
16
17
Console.WriteLine("Input String : " + inputString);
18
Console.WriteLine("After Removing Special Characters By Replace Method : " + RemovingSpecialCharactersByRegex(inputString));
19
Console.WriteLine("After Removing Special Characters By REGEX : " + RemovingSpecialCharactersByRegex(inputString));
20
Console.WriteLine("After Removing Special Characters By Loop : " + RemovingSpecialCharactersByLoop(inputString));
21
}
22
23
public static string RemovingSpecialCharacters(string inputString)
24
{
Cached Result