devxlogo

October 25, 2001

LTrim(),RTrim(),Trim() Functions in JavaScript

JavaScript lacks the Trim() function. See below the code for trimming a string: function LTrim(ValueToTrim){ValueToTrim =ValueToTrim.toString()var WhiteSpace=new String(” “);var i=0;while(WhiteSpace.indexOf(ValueToTrim.charAt(i))>-1){ i++;}return ValueToTrim.substring(i);}function RTrim(ValueToTrim){ ValueToTrim =ValueToTrim.toString() var WhiteSpace=new String(” “); var

Unicode and the Watch Debugger Window

Managing Unicode strings (LPWSTR, BSTRs, etc.) is now a very common task. However, Visual Studio 6 does not allow you to view Unicode strings correctly in the watch window. It

Security101: MessageDigest Class

In Java, message digest is represented by “java.security.MessageDigest class”.All main classes in java.security package are instantiated using the factory method “getInstance()”.This method takes the String parameter, which is the name

Security101: MessageDigest

Message digest is a hash code of a byte sequence (message).It has certain properties that make it very unique and very useful: It has a fixed size (in bytes), which