Rev 223 | Rev 252 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 223 | Rev 242 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | import java.util.Vector; |
|
- | 2 | ||
1 | public final class DUBwiseHelper |
3 | public final class DUBwiseHelper |
2 | { |
4 | { |
3 | public final static String ip_digit_zeroes(int digit) |
5 | public final static String ip_digit_zeroes(int digit) |
4 | { return "" + digit/100 + "" + (digit/10)%10 + "" + (digit)%10; } |
6 | { return "" + digit/100 + "" + (digit/10)%10 + "" + (digit)%10; } |
Line 22... | Line 24... | ||
22 | 24 | ||
23 | return res; |
25 | return res; |
Line -... | Line 26... | ||
- | 26 | } |
|
- | 27 | ||
- | 28 | ||
- | 29 | public final static String[] split_str(String str,String sep) |
|
- | 30 | { |
|
- | 31 | ||
- | 32 | Vector nodes = new Vector(); |
|
- | 33 | ||
- | 34 | // Parse nodes into vector |
|
- | 35 | int index = str.indexOf(sep); |
|
- | 36 | while(index>=0) { |
|
- | 37 | nodes.addElement( str.substring(0, index) ); |
|
- | 38 | str = str.substring(index+sep.length()); |
|
- | 39 | index = str.indexOf(sep); |
|
- | 40 | } |
|
- | 41 | // add last element |
|
- | 42 | nodes.addElement( str ); |
|
- | 43 | ||
- | 44 | // Create splitted string array |
|
- | 45 | String[] result = new String[ nodes.size() ]; |
|
- | 46 | if( nodes.size()>0 ) { |
|
- | 47 | for(int loop=0; loop<nodes.size(); loop++) |
|
- | 48 | { |
|
- | 49 | result[loop] = (String)nodes.elementAt(loop); |
|
- | 50 | System.out.println(result[loop]); |
|
- | 51 | } |
|
- | 52 | ||
- | 53 | } |
|
- | 54 | ||
- | 55 | return result; |
|
- | 56 | } |
|
24 | } |
57 | |
25 | 58 | ||
Line 26... | Line 59... | ||
26 | 59 |