The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

why line feed and carriage 0x0A , 0x0D gives errror in program below

Posted by Dilip on February 01, 2001 at 5:29 AM

Dear Sir,

i get the result of the program as -1 instead the location of line feed i.e spaces. Kindly help me to solve this.

----
class indexOfDemo {

public static void main(String args[]) {
String s = "Now is the time for all good men";

System.out.println("indexOf(t, 10) ="+s.indexOf(0x0A, 0));}
}
---

thankyou,

urs sincerely,
dilip



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us