1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| package com.jcdm.main.restful.factoryMes.controller;
|
| import java.util.*;
|
| public class testClass {
| public static void main(String[] args) {
| String str = "123990016680564";
| List<String> l = new ArrayList<>();
| l.add("9900166805");
| l.add("9900171753");
| l.add("9900173353");
| Integer i = 0;
| String o = "";
| for (String s : l) {
| if(str.contains(s)){
| i = s.length();
| o = s;
| break;
| }
| }
| System.out.println(i);
| System.out.println(o);
|
|
|
| }
| }
|
|