image1 image2 image3

HELLO I'M NITENDRA THAKUR|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M PROFESSIONAL ANDROID APPLICATION DEVELOPER

JAVA CODES

Code to find out the length of string(space+characters) :)

class stringdemo10
{
  static  int length(String s)
  {
   System.out.println(s.length());
   int i=0;
   int count=0;
   try
   {
    while(s.charAt(i)!='\0')
    {
     count++;
     i++;
    }
  
   }
   catch(Exception e)
    {}
   return count;

   }
  public static void main(String aa[])
  {
   System.out.println("length:"+length("      i love india     "));
   }
}

Share this:

CONVERSATION

0 comments:

Post a Comment