keymasterviriya1150

Untitled

Feb 21st, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. public class NewClass {
  2.     public static void main(String[] args) {
  3.         System.out.println(extratit("puket.psu.ac.th/*aaa.html"));
  4.     }
  5.     static String extratit(String url)
  6.     {
  7.         String f = null;
  8.         String[]t=url.split("/");
  9.       // System.out.print(t[t.length-1]);
  10.        if(t[t.length-1].startsWith("*"))
  11.        {
  12.            f="_"+t[t.length-1].substring(1);
  13.            
  14.             return f;
  15.        }
  16.        else{
  17.            return t[t.length-1];
  18.        }
  19.        
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment