Monday, October 5, 2015

Program to find the length of String without using buit-in function.

import java.util.*;
class SLength
{
public static void main(String args[])
{
int len=0;
String str="Welcome to Java Programing";
char a[]=str.toCharArray();
for(int i=0;i<a.length;i++)
{
len++;
}
System.out.println("String Length="+len);
}
}

No comments:

Post a Comment