Jump to content
  • Advertisement
Sign in to follow this  
aravindva

help needed in string program

This topic is 3979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!