src/Microsoft.VisualStudio.Editor.UnitTests/PropertyPages/WPF/AppDotXamlDocumentTests.cs
/// <summary>
/// Given a string, and a character such as #, determines the 0-based index of
///   the first instance of that character, and removes it from the string.
///   
/// Example:
///   Input:  This is a #test#.
///   Output text: This is a text#.
///   Output codedCharIndex: 10
/// </summary>
/// <param name="text"></param>
/// <param name="codedChar"></param>
/// <param name="codedCharIndex"></param>
/// <returns></returns>
Given a string, and a character such as #, determines the 0-based index of
the first instance of that character, and removes it from the string.

This is a #test#.
Output text: This is a text#.
Given a string and a character such as # determines the 0 - based index of the first instance of that character and removes it from the string . This is a #test# . Output text : This is a text# .
private string RemoveCodedCharacter(string text, char codedChar, out int codedCharIndex)
        {
            codedCharIndex = text.IndexOf(codedChar);
            if (codedCharIndex >= 0)
            {
                return text.Substring(0, codedCharIndex) + text.Substring(codedCharIndex + 1);
            }
            else
            {
                return text;
            }
        }
private string RemoveCodedCharacter ( string text , char codedChar , out int codedCharIndex ) { codedCharIndex = text . IndexOf ( codedChar ) ; if ( codedCharIndex >= 0 ) { return text . Substring ( 0 , codedCharIndex ) + text . Substring ( codedCharIndex + 1 ) ; } else { return text ; } }
Given a string, and a character such as #, determines the 0-based index of
the first instance of that character, and removes it from the string.
Given a string and a character such as # determines the 0 - based index of the first instance of that character and removes it from the string .
None
text
string
None
codedChar
char
None
int
out
codedCharIndex
None