wood burning stoves
The moose likes Beginning Java and the fly likes Help me with strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help me with strings" Watch "Help me with strings" New topic

Help me with strings

Liza Misra
Ranch Hand

Joined: Mar 26, 2001
Posts: 32
I want to check for the number of occurences of a particular character in a string ignoring case.
Is it possible to use equalsIgnoreCase(),meant for strings?
I tried something like:
but it gives error (char can not be dereferenced).
Please comment.
Joseph Russell
Ranch Hand

Joined: Jan 08, 2001
Posts: 290
I'll answer your question but to restate what Marylin already said in your thread about interfaces this question doesn't have anything to do with the Cattle Drive assignments. It would be better for you to put them in Java In General( beginner ).
This might be a little sloppy but it works. I'd appreciate some suggestions as to how to make it look better.

Maybe this should be moved to Java in General? Let me know if it does get moved.
[This message has been edited by Joseph Russell (edited March 27, 2001).]
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
equalsIgnoreCase() compares two Strings ignoring case differences in the two Strings.
But, you could do something like this:

I'm moving this to Java in General (Beginners)

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link: http://aspose.com/file-tools
subject: Help me with strings
It's not a secret anymore!