Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
Compare Array with String
nani aman
Ranch Hand
Posts: 33
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi, i have a
string
and an array of character.
String = "solve"
Array = {r,e,s,o,l,v,e}
how i can compare the string with the array to know that the string is in the array?
thank you. :roll:
Sonny Gill
Ranch Hand
Posts: 1211
I like...
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I suggest that you have a look at the charAt method in java.lang.String class, and the String constructor that takes a character array as input.
Rohan Kayan
Ranch Hand
Posts: 123
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can create a new String object with char[] in its constructor and then you can use
public int compareTo(String anotherString)
SCWCD 1.4, SCJP 1.4
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how compare array of string
Can I sort String arrays?
Compare string to a String in array
how to compare string Array with different string
Beta Search Criteria:
More...