1、Replace C#:(using System.Text.RegularExpressions;) string txt = Regex.Replace(txtLog.Text.ToString(), "/(^\\s*)|(\\s*$)/g", ""); js: var txt = docum ...
1、Replace
C#:(using System.Text.RegularExpressions;) string txt = Regex.Replace(txtLog.Text.ToString(), "/(^\\s*)|(\\s*$)/g", "");
js: var txt = document.all.txtLog.value.replace(/(^\s*)|(\s*$)/g, "");