Probably the fastest way is to convert it to an array of characters and then
step through them comparing as you go.  Something like this:

public boolean testIt () {
  String authorization = rs.getString("CUOPTN");
  char[] auth = authorization.toCharArray();

  for(int i = 0;i < auth.length;i++) {
    if(auth[i] == 'X') {
      return true;
    }
  }
  return false;
}

Hope this helps.
    (*Chris*)

----- Original Message -----
From: Jeetandra Mahtani <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 05, 1999 1:30 PM
Subject: Extracting characters


> Hello,
> I have extracted a string from a table by the
> following:
> String authorization = rs.getString("CUOPTN");
> Can someone tell me how I could extract each
> character in the string and the length of the string?
> Basically I am trying to compare each character in
> the string with a value, so I'll need the length and
> each character in the string.
> Thanks,
> J
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to