Sign in to follow this  
aravindva

help needed in string program

Recommended Posts

aravindva    122
can somebody help me with following problem...its very urgent.. Given a string and a sub-string as input, write a function to return the number of occurrences and/or position of the first occurrence.

Share this post


Link to post
Share on other sites
ToohrVyk    1595
The only situation where such a program would be needed is as part of an assignment. Since you're stating that's it's urgent, I can assume that it's not from a book you're reading on your own, but rather either from your school, or from a job interview. Whichever case it is, homework questions are now allowed on this forum for your own good. In order to get an answer, please provide justification about why you:
  • Need such elementary functionality (it's in the standard library of about just every language)
  • Need it to be written, instead of provided from aforementioned standard libraries.
  • Need to do so urgently.


Either way, look for strpos in C and PHP, std::string::find in C++, String.find in O'Caml, and so on.

Share this post


Link to post
Share on other sites
Zahlman    1682
Quote:
Original post by ToohrVyk
TIn order to get an answer, please provide justification about why you:
  • Need such elementary functionality (it's in the standard library of about just every language)
  • Need it to be written, instead of provided from aforementioned standard libraries.
  • Need to do so urgently.


  • Describe it in terms that sound copied directly from an assignment sheet.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this