I need to recursively write a function that determines if a prefix, for example 'f', is the prefix of a string. If it is the prefix, it needs to return True, and if it is not the prefix, it needs to return False. How do I do this?
Asked
Active
Viewed 2,405 times
0
-
1any attempts any ex? – Avinash Raj Oct 07 '15 at 02:44
-
Show what you've tried so far and where you've gotten stuck. – Hayley Guillou Oct 07 '15 at 02:44
-
Heard of [`startswith`](https://docs.python.org/2/library/stdtypes.html#str.startswith)? – Code Different Oct 07 '15 at 02:50
-
Does this answer your question? [Checking whether a string starts with XXXX](https://stackoverflow.com/questions/8802860/checking-whether-a-string-starts-with-xxxx) – Leonard Dec 04 '22 at 04:04