The Artima Developer Community
Sponsored Link

Java Answers Forum
arrays and string......removing comma

2 replies on 1 page. Most recent reply: Jul 22, 2002 5:13 AM by thomas

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
uzma

Posts: 1
Nickname: ozma
Registered: Jul, 2002

arrays and string......removing comma Posted: Jul 22, 2002 12:44 AM
Reply to this message Reply
Advertisement
hi...
i ve a problem dealing arrays...i ve to remove commas from user input.i ve removed the commas and put the elements in a list but now for sorting those elements i need to put those elements in the array...here im having the problem...i get the error message,"can't convert string[] to string or int"...now tell me how to convert the elements in the list into an array??


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: arrays and string......removing comma Posted: Jul 22, 2002 1:56 AM
Reply to this message Reply
use the method toArray()

thomas

Posts: 42
Nickname: turbomanic
Registered: Jul, 2002

Re: arrays and string......removing comma Posted: Jul 22, 2002 5:13 AM
Reply to this message Reply
Use the string tokenizer class. This way you can determine how large the array has to be using count tokens and you can then simply use nextToken() to get each element to add to the array.

Flat View: This topic has 2 replies on 1 page
Topic: How do i access Vector elements? Previous Topic   Next Topic Topic: Java to VC++ Communication

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use