2010-10-12 39 views

回答

3

只要写在代码中此方法:

public static string GetTextonly(string editorcontent) 
{ 
    string strtext = ""; 
    strtext = Regex.Replace(editorcontent, @"<(.|\n)*?>", string.Empty); 
    return strtext; 
} 

写在这之后外界:

string plaintext = GetTextonly(txtMessage.Content); 

您只需添加名称空间System.Text.RegularExpression

相关问题