• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting String Array  RSS feed

 
Tempora Telora
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple question. Trying to sort a array of strings need to use ignorecase command. When I try and run it keeps stating that it is expecting one type and recieving another.

x[i].comparetoignorecase((string) y[i])

I know its not right but it is close any ideas?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a slightly different way

 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is case-sensitive, so writing "compareToIgnoreCase" as "comparetoignorecase" and "String" as "string" can cause all sorts of interesting error messages. Consult the Java API docs and try to get all the capitalization right, and see if that doesn't improve things.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!