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
28
29
30
31
32
| package com.ks.tool.bkz.util.sdlj;
|
| public class DocTemplateUtil {
|
| public static boolean IsRight(String doc) {
| //匹配两个中括号
| int start1= doc.indexOf("[");
| if (start1 <= -1) {
| return false;
| }
|
| int end1 = doc.indexOf("]", start1);
| if (end1 <= -1) {
| return false;
| }
|
| int start2 = doc.indexOf("[", end1);
| if (start2 <= -1)
| {
| return false;
| }
|
| int end2 = doc.indexOf("]", start2);
| if (end2 <= -1)
| {
| return false;
| }
|
| return true;
| }
|
| }
|
|