public string GetString (string data) {string DataFormat = string.
Empty; if (data. Length = =//2014/11/23 {dataformat = data.
Replace ("/", ""); } if (data. Length = = 9)//2014/11/1 or 2014/1/12 {//The function is to intercept and replace the IF (data) first. Substring (4, 3). Replace ("/", ""). Length = = 2)//2014/11/1 {data = data.
Replace ("/", ""); DataFormat = data. Substring (0, 4) + data. Substring (4, 2) + "0" + data.
Substring (6, 1); } ELSE//2014/1/12 {data = data.
Replace ("/", ""); DataFormat = data. Substring (0, 4) + "0" + data. Substring (4, 1) + data.
Substring (5, 2); } if (data. Length = = 8)//2014/1/2 {data = data.
Replace ("/", ""); DataFormat = data. Substring (0, 4) + "0" + data. Substring (4, 1) + "0" + data.
Substring (5, 1);
return dataformat; }
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/