Fix bug in grep method

This commit is contained in:
0xb00bface 2021-01-23 13:11:59 +01:00
parent 62cafd7b40
commit e9a71bd6f1
1 changed files with 4 additions and 1 deletions

View File

@ -83,6 +83,9 @@ public class StringUtil {
result.append(line).append('\n'); result.append(line).append('\n');
} }
} }
return result.deleteCharAt(result.length() - 1).toString(); if (result.length() >= 2) {
result = result.deleteCharAt(result.length() - 1);
}
return result.toString();
} }
} }