File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes charAt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "charAt" Watch "charAt" New topic


Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
original String is:
if i wrote code and display every character of string
for (int i=0;i < str.length();i++)
Why? How I get everycharacter of this String
(edited by Cindy to put space by < so it wouldn't be treated as html)
[This message has been edited by Cindy Glass (edited August 09, 2001).]

Senior software engineer
rajesh purohit
Ranch Hand

Joined: May 02, 2001
Posts: 33
what is ur for loop?
plz specify. you might be incrementing it by 2 characters, b'cos ur string is printing alternate characters
bye for now
Rajesh Purohit
visit me at

Bye for Now<P>Rajesh Purohit<BR>INDIA
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Works fine for me.
I used
<br /> Then keyed in the exact string that you gave:<br /> >java Test lfpdh,8256:8,64=8877,4;;6578;576;9444'87,U@Y%71(;876,HG\

I would guess that you are reading the string from a file, and the read mechanism isn't doing what you think that it is.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: charAt
It's not a secret anymore!