i need help!

Правка en1, от fares, 2015-10-24 10:27:22

hi guys: i solved this problem : http://codeforces.me/problemset/problem/58/A

then i saw a code that an orange user used to solve it , here is the code: import java.util.Scanner; public class Main{

     public static void main(String[] args) throws Exception {
         Scanner in = new Scanner(System.in);

         String[] str = in.nextLine().split(".*h.*e.*l.*l.*o.*");
         System.out.println(str.length == 0 ? "YES" : "NO");

     }

}

i understand that the split method splits the String when it finds the String parameter given to it , then it puts the substrings
into the array . but what is all the "." and "*" do? what does this code do?

Теги help, split

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский fares 2015-10-24 10:27:22 721 Initial revision (published)