How can I write a function that returns the index of a single character in a string without using the index method a.k.a string.index('some random character')?
-
Why can't you use that method?jhocking– jhocking2011-04-02 00:23:12 +00:00Commented Apr 2, 2011 at 0:23
-
en.wikipedia.org/wiki/String_searching_algorithmYXD– YXD2011-04-02 00:25:43 +00:00Commented Apr 2, 2011 at 0:25
-
jhocking -- its specified in the instructions of my hw set not use that method Mr E -- thank you for the link, unfortunately its all greek to me =/Jay– Jay2011-04-02 00:29:19 +00:00Commented Apr 2, 2011 at 0:29
-
Thank you everybody, the answers you all gave are all valid Once again, Thank you very much!Jay– Jay2011-04-02 00:36:27 +00:00Commented Apr 2, 2011 at 0:36
-
Mr E gave you the link because you wrote "function that returns the index of a string" whereas you meant "function that returns the index of a char". The first is a much more comple problem.frnhr– frnhr2011-04-02 01:01:26 +00:00Commented Apr 2, 2011 at 1:01
Add a comment
|