C # Tab Filter processing method, dynamically replace the characters inside the character box.
<summary>///descrioption:///need to replace the character set, see msdn///the Trim method only trims 0x0009, 0x000a, 0x000b, 0x000c, 0x00 0d, 0x0085, 0x2028, and 0x2029.///This array adds in control characters.///Author: Hui Yifang//Create date:2014-03-06// /<summary>public static readonly char[] Whitespacechars = new char[] {(char) 0x00, (char) 0x01, (char) 0x02, (char) 0x , (char) 0x04, (char) 0x05, (char) 0x06, (char) 0x07, (char) 0x08, (char) 0x09, (char) 0x0a, (char) 0x0b, (char) 0x0c, (c HAR) 0x0d, (char) 0x0e, (char) 0x0f, (char) 0x10, (char) 0x11, (char) 0x12, (char) 0x13, (char) 0x14, (char) 0x15, (char) 0x (char) 0x17, (char) 0x18, (char) 0x19, (char) 0x20, (char) 0x1a, (char) 0x1b, (char) 0x1c, (char) 0x1d, (char) 0x1e, (ch AR) 0x1f, (char) 0x7f, (char) 0x85, (char) 0x2028, (char) 0x2029, (char) 0x0027, (char) 0x0022, (char) 0x005c, (char) 0x0000 , (char) 0x0007, (char) 0x0008, (char) 0x000c, (char) 0x000A, (char) 0x000d, (char) 0x0009, (char) 0x000b}; <summary>///descrioption:///Qingwhitespace characters///Author: Hui Yifang//Create date:2014-03-06///</summary>///<param name= "value" >///<RETURNS>&L T;/returns>public static string Notnullorblank (this string value) {string result = string. Empty; if (!string. IsNullOrEmpty (value)) {result = value. Trim (Whitespacechars); } if (!string. IsNullOrEmpty (Result)) {result = Stringtopattern (result); } return result; <summary>///descrioption:///Replacement Tab///Author: Hui Yifang//Create date:2014-03-06///</summary>///</s Ummary>///<param name= "Content" > What to Filter//<returns> return content to filter complete </returns>public static string Stringtopattern (String content) {if (content. Trim (). Equals ("")) {return string. Empty; } else {for (int i = 0; i < whitespacechars.length; i++) {content = content. Replace (Whitespacechars[i]. ToString (), ""); }} return content;} </summary>
Above is the C # tab filter processing method content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!