Solved

How to find char position in a string?

Posted on 2013-05-23
2
634 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 54

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

823 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