c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
c# .net

If input has hyphen then replace space c#?

| | CSharp

I want to replace hyphen with space in asp.net c#. Here I
used replace method from c# library System.Text.RegularExpressions.




Example:



I
created a function named ReplaceHyphen,


string term = HtmlUtility.ReplaceHyphen(term);


 


public static string ReplaceHyphen(string text)


 {


     string my_String = Regex.Replace(text, "-", " ");


     return my_String;


 }