|
-
Feb 25th, 2002, 10:26 AM
#1
Thread Starter
Hyperactive Member
Instring equavalant
He everyone,
Does Java has a instring equavalant? I must know the number of a specified character in a string?
Grtz,
Bloged
-
Feb 25th, 2002, 10:32 AM
#2
have a look at the StreamTokenizer class
-
Feb 25th, 2002, 10:35 AM
#3
Thread Starter
Hyperactive Member
Re: streamTokenizer
Thnx i will have a look!
Grtz,
Bloged
-
Feb 25th, 2002, 10:41 AM
#4
Thread Starter
Hyperactive Member
Example
How do I loop through a file? please can you give an example?
I now use:
while strString.tt_eol
{
}
strString is a string
Thanx in advance
Grtz,
Bloged
-
Feb 25th, 2002, 10:42 AM
#5
not a problem at all
-
Feb 25th, 2002, 10:44 AM
#6
Thread Starter
Hyperactive Member
It is a problem for me so can you please give me an example!
Grtz,
Bloged
-
Feb 25th, 2002, 10:46 AM
#7
Code:
while (st.type != StreamTokenizer.TT_EOL && st.ttype != StreamTokenizer.TT_EOF
{
//code
st.nextToken();
}
where st is an instance of the StreamTokenizer class
-
Feb 25th, 2002, 03:55 PM
#8
Dazed Member
Bloged
Does Java has a instring equavalant? I must know the number of a specified character in a string?
To get the index value of a specific character in a string
use the public int indexOf(char c) or public int indexOf(char c, int fromIndex)
Last edited by Dilenger4; Feb 25th, 2002 at 03:59 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|