Java Programing
Pages
Home
Projects
Tricks
Contact Us
About Us
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment