Guest User

Untitled

a guest
Jul 18th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.regex.Pattern;
  2. import java.util.regex.Matcher;
  3.  
  4. public class Length
  5. {
  6.  
  7.     public static int lengthFunc(char s1[])
  8.     {
  9.         Matcher m = Pattern.compile("$").matcher(String.valueOf(s1));
  10.         m.find();
  11.         int size = m.end();
  12.         return size;
  13.     }
  14.  
  15.     public static void main(String[] args) {
  16.         char s1[] = {5,1,0,4,2,3};
  17.         System.out.println(lengthFunc(s1));
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment