Solved

How to find char position in a string?

Posted on 2013-05-23
2
630 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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

932 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

13 Experts available now in Live!

Get 1:1 Help Now