I have a line like this:
string text = "6A7FEBFCCC51268FBFF";
And I have one method for which I want to insert logic to add a hyphen after 4 characters to the text variable. So, the output should be like this:
6A7F-EBFC-CC51-268F-BFF
The transfer of variables to the text variable above should be added to this method;
public void GetResultsWithHyphen
{
}
And I want to also remove the hyphen from the given string , for example 6A7F-EBFC-CC51-268F-BFF. Thus, removing this hyphen from string logic should be inside this method;
public void GetResultsWithOutHyphen
{
}
How to do it in C # (for desktop application)? What is the best way to do this? Appreciate each answer in advance.
source
share