Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.regex.Pattern;
- import java.util.regex.Matcher;
- public class Length
- {
- public static int lengthFunc(char s1[])
- {
- Matcher m = Pattern.compile("$").matcher(String.valueOf(s1));
- m.find();
- int size = m.end();
- return size;
- }
- public static void main(String[] args) {
- char s1[] = {5,1,0,4,2,3};
- System.out.println(lengthFunc(s1));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment