473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Basic: How to get a specific character from a string?

Thanks.
Nov 16 '05 #1
3 5516
for(int i=0; i<s.Length; i++)
{
if (s[i] == charVariableForCharLookingFor)
{
// grab the index or return true or whatever you need to do when you
find it.
}
}

Juan wrote:
Thanks.


--
--
Patrick Altman
<><
Nov 16 '05 #2
Thanks.
"Patrick Altman" <pa**********@gmail.com> escribió en el mensaje
news:eH**************@TK2MSFTNGP10.phx.gbl...
for(int i=0; i<s.Length; i++)
{
if (s[i] == charVariableForCharLookingFor)
{
// grab the index or return true or whatever you need to do when you
find it.
}
}

Juan wrote:
Thanks.


--
--
Patrick Altman
<><

Nov 16 '05 #3
RCS
also, you could do

int intPosition = s.IndexOf(charVariableForCharLookingFor)
"Patrick Altman" <pa**********@gmail.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
for(int i=0; i<s.Length; i++)
{
if (s[i] == charVariableForCharLookingFor)
{
// grab the index or return true or whatever you need to do when you find
it.
}
}

Juan wrote:
Thanks.


--
--
Patrick Altman
<><

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: CHANGE username to westes | last post by:
What are the most popular, and well supported, libraries of drivers for bar code scanners that include a Visual Basic and C/C++ API? My requirements are: - Must allow an application to be...
7
by: dan | last post by:
hey peeps, i am completely new at c++ and i need some help with an assignment. it is basically about file i/o with fstreams. i understand how to open a file with fstream, but how would you read,...
6
by: E Pease | last post by:
I have been trying to edit the Explorer example by Dev Ashish I found on www.msvp.org (I think). I have been all over the net so I am not quite sure where the file came from. I like the way it...
28
by: Dave | last post by:
Below is the code ive written just to count the characters typed in. I assumed EOF is -1, so if i type -1 and then press enter shouldnt the program end? It orks if i put something like 'q' in the...
15
by: C# Learner | last post by:
Hi, I have a string (System.String) which holds some data. This data is encoding in UTF8 (i.e. anywhere in the string where there should be a single 'é' character, there will be two characters...
5
by: Christian Blackburn | last post by:
Hi Gang, I would like to use a caesar cipher on the mailto: links in my website to prevent crawlers from farming the e-mails off my site. Can someone tell me the equivalents to Chr() and Asc()...
3
by: Simon Hart | last post by:
Hi, I am trying to implement some functionality as seen in MS CRM 3.0 whereby a basic Xml is deserialized into an object which contains properties. What I want to do from here is; cast the basic...
4
by: Voli | last post by:
I have a question about: and i only know really basic c++ none of the really fancy stuff :( How to convert integers into a string/character array? and How do I search for specific...
6
by: borophyll | last post by:
Hi Please let me know if I have this clear. The basic source character set is the list of (96) characters that all implementations must have in their vocabulary. All other characters...
6
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.