如何去除流转义序列 [英] How to remove escape sequences from stream
本文介绍了如何去除流转义序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个快速的方法来找到(删除)所有转义序列一>从流/字符串??
is there an quick way to find(and remove) all escape sequences from a Stream/String??
推荐答案
希望波纹管语法将有助于全力为您
Hope bellow syntax will be help full for you
string inputString = @"hello world]\ ";
StringBuilder sb = new StringBuilder();
string[] parts = inputString.Split(new char[] { ' ', '\n', '\t', '\r', '\f', '\v','\\' }, StringSplitOptions.RemoveEmptyEntries);
int size = parts.Length;
for (int i = 0; i < size; i++)
sb.AppendFormat("{0} ", parts[i]);
这篇关于如何去除流转义序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文