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