M
Mark Baldwin
Bearing in mind the overhead of handling strings in .NET, which is more
efficient...
// trim once but use temporary
string s1 = textBox1.Text.Trim();
if (s1.Length > 0)
s2 = s1;
OR
// trim twice with no temporary
if (textBox1.Text.Trim().Length > 0)
s2 = textBox1.Text.Trim();
efficient...
// trim once but use temporary
string s1 = textBox1.Text.Trim();
if (s1.Length > 0)
s2 = s1;
OR
// trim twice with no temporary
if (textBox1.Text.Trim().Length > 0)
s2 = textBox1.Text.Trim();