i need help!

Revision en1, by 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?

Tags help, split

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English fares 2015-10-24 10:27:22 721 Initial revision (published)