answersLogoWhite

0


Best Answer

Use length() method.

Example:

"java".length();

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can find the length of a string in java without using fun?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Find length of the string without using loops and control structures?

length = strlen(string);


How do you find the length of string without using strlen function in MySQL?

SELECT char_length (...) FROM ...


C plus plus code to find the length of a string without using function?

int i = 0; while(str[i] != NULL){ i++; }


How do you find the length of string without using the strlen function in PHP?

$str = "Hello"; $nameArr=str_split($str); print_r($nameArr); echo "length: ".count($nameArr);


How do you find the length of the string using strlen?

int len = strlen("some string"); // len has value 11


How do you find the perimeter of a jigsaw puzzle using string?

You can find the perimeter of any planar (flat) object using string by wrapping the string around the outside of the object, noting the point on the string where you return to the starting point, and then measuring the length of that portion of the string.


Program to find the size of the string without using string functions?

You can't. If you want to find the length of a String object, you must use at least one of the String methods. Simply iterate over your char* and count the number of characters you find before you reach the null character . int strLength(const char* str) { int length = 0; // take advantage of the fact that all strings MUST end in a null character while( str[length] != '\0' ) { ++length; } return length; }


The side lengths of a rectangular room are 6 ft and 8 ft. The room is going to be split in half along the hypotenuse of a triangle using string. Find the length of the piece of string needed.?

Using Pythagoras' theorem the length of the hypotenuse is 10 feet which will be the length of the string needed


Find out the square root for that given number using string?

Halv that given number,Make a square that has that half number as the length of a side.Stretch the string across the diagonal of the square from corner to corner.The length of the string is the square root of the given number


How can you find the circumference of the quarter without using the math formula?

The circumference of any circle is the distance around the outside. You can take a piece of string and measure the outside of the quarter. See how much string fits around the outside. Then put that length of string up against the edge of a ruler and see how long it is.


Weite a your own progrem to find a length of string without using library function?

int mystrlen (char* str) { int len = 0; while (*str++ != '\0') len++; return len; }


How do you measure bust without a measuring tape?

If you have a ruler and a piece of string, you could use the string to find the distance around the bust (or whatever you wanted to measure), mark the point at where the string starts to overlap, then measure the string using the ruler.