By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

Java's StringTokenizer is *what* in .NET?

P: n/a
Hi there,

What would be the counterpart for Java's StringTokenizer class in .NET?

In fact, does anybody know a good web site that gives this kind of
information, like a Java-.NET/.NET-Java dictionary or equivalency table?

Many thanks,

--
Carlitos
Nov 16 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I guess the closest thing is the Regex class.

This sites claims to have a StringTokenizer in C#. I have not looked at
that myself though.

http://www.c-sharpcorner.com/Code/20...gTokenizer.asp

/Joakim

Carlitos wrote:
Hi there,

What would be the counterpart for Java's StringTokenizer class in .NET?

In fact, does anybody know a good web site that gives this kind of
information, like a Java-.NET/.NET-Java dictionary or equivalency table?

Many thanks,

Nov 16 '05 #2

P: n/a
Use the Split() method on the string object...

i.e. :

string[] strings = myString.Split(new char[] { ';' });
Nov 16 '05 #3

P: n/a
from http://java.sun.com/j2se/1.4.2/docs/...okenizer.html:

StringTokenizer is a legacy class that is retained for compatibility reasons
although its use is discouraged in new code. It is recommended that anyone
seeking this functionality use the split method of String or the
java.util.regex package instead.
The following example illustrates how the String.split method can be used to
break up a string into its basic tokens:

String[] result = "this is a test".split("\\s");
for (int x=0; x<result.length; x++)
System.out.println(result[x]);
prints the following output:

this
is
a
test
^ the .net version of that is pretty much identical to java
"Carlitos" <Ca******@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
Hi there,

What would be the counterpart for Java's StringTokenizer class in .NET?

In fact, does anybody know a good web site that gives this kind of
information, like a Java-.NET/.NET-Java dictionary or equivalency table?

Many thanks,

--
Carlitos

Nov 16 '05 #4

P: n/a
http://spaces.msn.com/members/staceyw/ for a regex example to split a string
on one or more whitespace chars into fields.

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Carlitos" <Ca******@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
Hi there,

What would be the counterpart for Java's StringTokenizer class in .NET?

In fact, does anybody know a good web site that gives this kind of
information, like a Java-.NET/.NET-Java dictionary or equivalency table?

Many thanks,

--
Carlitos


Nov 16 '05 #5

P: n/a
Many Thanks to everyone who answered my question.

C

"Carlitos" wrote:
Hi there,

What would be the counterpart for Java's StringTokenizer class in .NET?

In fact, does anybody know a good web site that gives this kind of
information, like a Java-.NET/.NET-Java dictionary or equivalency table?

Many thanks,

--
Carlitos

Nov 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.