Tag Archives : string

Print the Stack Trace of the Exception to a String

Print the Stack Trace of the Exception to a String

When an exception occurs, this code snippet will print the stack trace of the exception to a string. This way, the exception stack trace at runtime can be recorded in log file. public static String getStackTrace(Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw...
Filed in: Java
0
Remove special characters from a string using JavaScript

Remove special characters from a string using JavaScript

Hi Guys, I would like to share a JavaScript snippet code which will remove special characters (like !, >, ?, ., # etc.,) from a string. Well, recently I was working on a project where in which I want to remove some special characters from a given string or user entered string. For that I have written...
Filed in: Javascript
1
© 2010 Developer Articles. All rights reserved.
Powered by: Aaban Technologies