fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String sampleString = "jrp_documento.jrp_doc_fornecedor|0;jrp_documento.jrp_doc_fornecedor";
  13. String[] items = sampleString.split(";");
  14. for(int i = 0; i < items.length; i++){
  15. if(items[i].charAt(items[i].length()-1) == '0'){
  16. System.out.println(items[i] + " termina em zero");
  17. }else{
  18. System.out.println(items[i] + " nao termina em zero");
  19. }
  20. }
  21.  
  22. }
  23. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
jrp_documento.jrp_doc_fornecedor|0 termina em zero
jrp_documento.jrp_doc_fornecedor nao termina em zero