473,387 Members | 1,456 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,387 software developers and data experts.

string help

26
String string = "one,two,three,four,five";
String[] tokens = string.split(",");

What is the value of tokens[2]?
"one"
"two"
"three"
"four"
None of the above


String string = "What is the position the number 2 in this string?";
int pos = string.indexOf("2");

What is the value of pos?
4
16
-1
32
None of the above
Aug 3 '07 #1
4 1096
blazedaces
284 100+
String string = "one,two,three,four,five";
String[] tokens = string.split(",");

What is the value of tokens[2]?
"one"
"two"
"three"
"four"
None of the above
"three"

String string = "What is the position the number 2 in this string?";
int pos = string.indexOf("2");

What is the value of pos?
4
16
-1
32
None of the above
32

Why are you asking this?
Aug 3 '07 #2
JosAH
11,448 Expert 8TB
Why are you asking this?
I'm so curious what you have won ;-)

kind regards,

Jos

ps. I bet it was just homework and the OP was cheating.
Aug 3 '07 #3
blazedaces
284 100+
I'm so curious what you have won ;-)

kind regards,

Jos

ps. I bet it was just homework and the OP was cheating.
I don't know why I didn't consider it yesterday but as soon as I as this thread again today I almost smacked myself...

Still, today as well as yesterday, these two questions just seem so inherently stupid that to cheat on them is just pathetic... Maybe I'm being a bit harsh...

-blazed
Aug 3 '07 #4
JosAH
11,448 Expert 8TB
I don't know why I didn't consider it yesterday but as soon as I as this thread again today I almost smacked myself...

Still, today as well as yesterday, these two questions just seem so inherently stupid that to cheat on them is just pathetic... Maybe I'm being a bit harsh...

-blazed
No, you're not being harsh at all, a bit naive mayhap by helping the OP with his
obvious questionaire (sp?) or his homework ;-)

kind regards,

Jos
Aug 3 '07 #5

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

Similar topics

11
by: Helmut Jarausch | last post by:
Hi, entering help('rstrip') or help('ljust') into IDLE's shell window I only get no Python documentation found ...
3
by: Imran Aziz | last post by:
Hello All, I am getting the following error on our production server, and I dont get the same error on the development box. Unable to cast object of type 'System.Byte' to type 'System.String'. ...
5
by: Sia Jai Sung | last post by:
Hi, I have a class that I modify from a sample program, like below ========================================== Imports System Imports System.Web.UI Imports System.Security.Cryptography ...
6
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
6
by: Calros Lo | last post by:
Dear all: I develop a programe that need when I get a string , such as "123" or "ABC",if I get string "123" and the system will help me to create new string "124" , if I get string "ABC" and the...
5
by: Joe Nova | last post by:
I'm a C++ noob and I need a little help manipulating strings. I've got a program that takes an expression in the form: "operand1 operator operand2" I'd like to: 1. Find the total length...
9
by: MikeB | last post by:
Hi, I'd appreciate some help, please. I'm writing a VS2005 VB project for school and one of the requirements is that every screen should have a "Help" button. I could do it by writing a clumsy...
8
by: Lucky | last post by:
hi guys! back again with another query. the problem is like this. i want to print a line like this: "---------------------------------------------" the easiest way is to simply assign it to...
13
by: mac | last post by:
Hi, I'm trying to write a fibonacci recursive function that will return the fibonacci string separated by comma. The problem sounds like this: ------------- Write a recursive function that...
37
by: xyz | last post by:
I have a string 16:23:18.659343 131.188.37.230.22 131.188.37.59.1398 tcp 168 for example lets say for the above string 16:23:18.659343 -- time 131.188.37.230 -- srcaddress 22 ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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,...

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.