answersLogoWhite

0

Implement the following method:

public static int stringLength(String s) {

if(s.equals("")) return 0;

else return stringLength(s.substring(0)) + 1;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is substr function does in c?

it will give the substring of length(as per the user) from the actual string,and the starting length from where it has to copy the substring from actual should be given by the user.


What is the law for length?

Law of length"For a given string under constant tension, the frequency of vibration is inversely proportional to the length of the string".


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


Function finds the occurrence of a given string in another string?

in C: strstr, declared in string.h


What is a recursive function?

A recursive function is one that calls upon itself until a given result in the original call is met. Take a look at this example. Program Recursion; Uses crt; Var number:longint; Function Factorial(number:longint):longint; Begin if number > 0 then factorial:=number*factorial(number-1) else factorial:=1; End; Begin clrscr; readln(number); writeln(factorial(number)); readln; End. Note how the function factorial calls itself.


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


How can you call a function given its name as a string?

we have to construct a table of two field structures,where the first field is the funtion name as a string and the second field is just the function name.then search the table to get a string match in the first field and use the second field to call the function.


What is th function of the charindex?

The CHARINDEX function in SQL is used to find the position of a specific character or substring within a string. It returns the starting position of the substring or character within the given string.


The rate at which something vibrates?

Is different depending on the material's length, thickness and the forcing function. Each of the 5 guitar strings, for example, vibrates at a different frequency also known as pitch. Additionally, you can change the pitch of a given string by effectively shortening it when you press the string against a fret.


Wap in c plus plus to find out the string is palindrome or not in?

use the strrev() function on the given string and compare with original string.If both are equal they are palindromes else not.


How would you implement a substr function that extracts a sub string from a given string?

substr(string, position [, count]) It extract substring starting from start and going for count characters. If count is not specified, the string is clipped from the start till the end


Write a c program to find GCD of two given integers by using both recursive n non recursive functions?

i love u darling