1
2
3
4
5
6
7
8
9 package it.imolinfo.jbi4corba.utils;
10
11 import java.util.StringTokenizer;
12
13
14 public class HelperStringUtils {
15
16
17
18
19
20
21
22
23
24 public static String ExtractString(final String target,final String start,final String endWith ) {
25
26
27 String result= null;
28 String currentToken=null;
29 StringTokenizer tokenizer=new StringTokenizer(target,start);
30 while(tokenizer.hasMoreTokens()){
31 if((currentToken=tokenizer.nextToken()).contains(endWith)){
32 result=currentToken;
33 }
34 }
35 int index=result.indexOf(endWith);
36 return result.substring(0, index);
37
38 }
39
40
41
42
43
44
45
46
47 public static boolean compareStringNoOrder(String str1,String str2){
48
49 StringTokenizer tk=new StringTokenizer(str2);
50 boolean sameSize=false;
51 if(str1.length()==str2.length())
52 sameSize=true;
53 boolean equals=true;
54 while(tk.hasMoreTokens()){
55 if(!str1.contains(tk.nextToken())){
56 equals=false;
57 break;
58 }
59
60 }
61 return equals;
62
63 }
64
65
66
67 }