Clear all non alphabetical figures in a String

Submitted by:Pitter Alderson

Date added:26 June, 2013

Category:MatLab

A project that needs to clear all non-alphabetical figures in a String and separating it every 60 characters(new line after 60 characters)..

Tags: clear memory

Code Snippet:

String str="dfae534&34(4645";
String newStr="";
for(int i=0;i<str.length();i++){
if(str.charAt(i)<96&&str.charAt(i)>65){
newStr+=str.charAt(i);
}
}
 
 

Comments