Created
          March 9, 2010 03:25 
        
      - 
      
 - 
        
Save tgab/326115 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // This is the code I used in java in order to get rid of leading | |
| // and trailing whitespace that the String.trim() function can't | |
| // handle | |
| // line is a String containing the current line I have just read | |
| // from the .asm file | |
| try { | |
| while (Character.isWhitespace(line.charAt(0))){ | |
| line = line.substring(1, line.length()); | |
| } | |
| while (Character.isWhitespace(line.charAt(line.length()-1))){ | |
| line = line.substring(0, line.length()-1); | |
| } | |
| } catch (IndexOutOfBoundsException e){ | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment