Solved

How to find char position in a string?

Posted on 2013-05-23
2
622 Views
Last Modified: 2013-05-24
How do I find the position (index) of a character in a string?

For instance, if the user entered: r

and my string  is:

The quick brown fox jumps over the lazy dog

How do I arrive at 11, as r is at position 11 in the string.

Thank you.
0
Comment
Question by:edvinson
2 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 39193501
0
 
LVL 1

Author Closing Comment

by:edvinson
ID: 39193543
quick and easy! thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now