Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] zaehlLeerzeichenUndTab(String txt){
- int[] ergebnis = new int[2];
- char[] chr = txt.toCharArray();
- for(int i = 0; i < chr.length; i ++){
- if(chr[i] == ' '){
- ergebnis[0] += 1;
- }
- if(chr[i] == '\t'){
- ergebnis[1] += 1;
- }
- }
- return ergebnis;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement