Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class K1_A {
- public static void main(String[] args) {
- String[] tab = {"Ala_1", "Ela_12", "Zenon_15", "Krystyna_6", "Lucjan_5"};
- for(int i = 0; i < tab.length; i++) {
- String nowy = "";
- for(int j = tab[i].lastIndexOf("_") - 1; j >= 0; j--) {
- nowy = nowy + tab[i].charAt(j);
- }
- nowy = nowy + "_";
- for(int j = tab[i].length(); j < tab[i].lastIndexOf("_"); j--) {
- nowy = nowy + tab[i].charAt(j);
- }
- tab[i] = nowy;
- System.out.println(tab[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement