Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Demo {
- public static void main(String[] args) {
- String string = new String("Каложуев Иван Егорович " +
- "Иисусов Егор Иванович " +
- "Железная Анка Сергеевна");
- String [] names = string.split(" ");
- for (int i = 0; i < names.length; i++) {
- if (names[i].equals("Иван")) {
- System.out.println("ЗДЕСЬ БЫЛ ИВАН");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement