ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/util/uk/org/iscream/cms/util/StringUtils.java
(Generate patch)

Comparing projects/cms/source/util/uk/org/iscream/cms/util/StringUtils.java (file contents):
Revision 1.1 by tdb, Sun Feb 4 04:56:08 2001 UTC vs.
Revision 1.3 by tdb, Wed Mar 14 23:25:29 2001 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2 < package uk.ac.ukc.iscream.util;
2 > package uk.org.iscream.util;
3  
4   //---IMPORTS---
5   import java.util.*;
# Line 46 | Line 46 | public class StringUtils {
46          }
47          return new String(textBuffer);
48      }
49 +    
50 +    /**
51 +     * This method takes an array of String's and a
52 +     * String to look for and returns the position
53 +     * in the array that the string occurs.
54 +     *
55 +     * @param search the string to look for
56 +     * @param array the array to look in
57 +     *
58 +     * @return the position in the array
59 +     */
60 +    public static int getStringPos(String search, String[] array) {
61 +        for(int x = 0; x < array.length; x++) {
62 +            if (array[x].equals(search)) {
63 +                return x;
64 +            }
65 +        }
66 +        return -1;
67 +    }
68  
69   //---CONSTRUCTORS---
70  
# Line 55 | Line 74 | public class StringUtils {
74       * Overrides the {@link java.lang.Object#toString() Object.toString()}
75       * method to provide clean logging (every class should have this).
76       *
77 <     * This uses the uk.ac.ukc.iscream.util.FormatName class
77 >     * This uses the uk.org.iscream.util.FormatName class
78       * to format the toString()
79       *
80       * @return the name of this class and its CVS revision

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines