Here's a challenge for you guys !
Write a function that returns the length of a string variable.
- Write a recursive function that only takes one parameter (of type string). Example:
public static int GetStrLen(string input)
// Get the length of the string: input
// Return the value for the length of this string
// Keep in mind the rules...
- This cannot be an iterative function, it must be recursive
- You cannot use any counter variable to keep track
- You cannot use any of the properties available to the string class or type (depending on what language you're using). (Ex: No use of the Length property for strings in .NET, no len() in Python, etc...)
I completed this in C#, and Python so far, lets see who else can do it!