473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to get String and Integer input at the same time?

1
Expand|Select|Wrap|Line Numbers
  1. public static void main(String[] args) 
  2. {
  3.         String acc =
  4.  JOptionPane.showInputDialog("Enter a string:");
  5.   int ia = Integer.parseInt(acc);
  6.         String[] s = acc.split(",");
if a user enter a,1,2,l,6 i want to seperate the string and integer.
Mar 6 '15 #1
0 1281

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Pycco | last post by:
I need the user to input an integer, and do some calculation with that integer. Should the user input an invalid integer, I must return a warning, saying it's an invalid input. E.g. int a;...
4
by: Marcus | last post by:
I was wondering if someone could help explain how an integer could be transformed into a time format. For instance I have an integer 62446 which should read 17:xx:xx or hhmmss (The colon seperators...
4
by: Shyguy | last post by:
I am working on an application in which the end user will enter a time, Say 3:00 PM, and a number, say 5 I want to create a number of records (5) as follows, 3:00:00 3:00:01 3:00:02 3:00:03...
2
by: Serge Fournier | last post by:
Hello, I want to set a database connection string at run time. To do that, I want to open the "data link property" window. I knew how to do that in VB6 (I used the MSDASC.DataLinks object). ...
50
by: Doug | last post by:
I can't imagine this is that hard but I'm sure having a struggle finding it. How do I convert a value like "111403" do a DateTime variable in DotNet (i.e. 11/14/2003)?
6
by: comp.lang.php | last post by:
I'm involved in a rather nasty debate involving a strange issue (whereby the exasperated tell me to RTFM even after my having done so), where this is insanely possible: print_r(is_int('1'));...
7
by: Rick | last post by:
With String.Format, if I have an incorrect number of args specified for a format string, compile fails. How can I implement similar design-time functionality for my own string functions?
8
by: kenneth6 | last post by:
How can I restrict the textbox in GUI C++ to integer-input ONLY ? bcoz the function inside can only process int input parameter.
1
by: triphoppa | last post by:
I have a question about non-integer input. Is there any way to "capture" all non-integer input and prompt for it? For example: if a user enters anything other than an integer I want to prompt the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.