Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String printTextPerRole(String[] roles, String[] textLines) {
- StringBuilder sb = new StringBuilder();
- for (String role : roles) {
- sb.append(role + ":\n");
- for (int i = 0; i < textLines.length; i++) {
- if (textLines[i].startsWith(role + ":")) {
- sb.append((i + 1) + ")" + textLines[i].substring(role.length() + 1) + "\n");
- }
- }
- sb.append("\n");
- }
- return sb.toString();
- }
Add Comment
Please, Sign In to add comment