Click here to Skip to main content
15,881,852 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to count a character in a string? Pin
PIEBALDconsult8-Jun-09 3:52
mvePIEBALDconsult8-Jun-09 3:52 
AnswerRe: How to count a character in a string? Pin
Blue_Boy8-Jun-09 3:54
Blue_Boy8-Jun-09 3:54 
GeneralRe: How to count a character in a string? Pin
Luc Pattyn8-Jun-09 4:50
sitebuilderLuc Pattyn8-Jun-09 4:50 
AnswerRe: How to count a character in a string? Pin
Manas Bhardwaj8-Jun-09 3:54
professionalManas Bhardwaj8-Jun-09 3:54 
GeneralRe: How to count a character in a string? Pin
SimpleData8-Jun-09 4:10
SimpleData8-Jun-09 4:10 
AnswerRe: How to count a character in a string? Pin
Skymir8-Jun-09 4:17
Skymir8-Jun-09 4:17 
GeneralRe: How to count a character in a string? Pin
Blue_Boy8-Jun-09 4:26
Blue_Boy8-Jun-09 4:26 
AnswerRe: How to count a character in a string? [modified] Pin
Luc Pattyn8-Jun-09 4:51
sitebuilderLuc Pattyn8-Jun-09 4:51 
and the cheapest approach probably is a.Length-a.Replace(";","").Length;

[CORRECTION]the single-line approach based on String.Replace is the most compact, however it is slower than an explicit loop checking every character, or looking for the next special character based on String.IndexOf; see my post below[/CORRECTION]

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

modified on Monday, June 8, 2009 1:29 PM

GeneralRe: How to count a character in a string? Pin
harold aptroot8-Jun-09 5:52
harold aptroot8-Jun-09 5:52 
GeneralRe: How to count a character in a string? Pin
Luc Pattyn8-Jun-09 7:17
sitebuilderLuc Pattyn8-Jun-09 7:17 
GeneralRe: How to count a character in a string? Pin
harold aptroot8-Jun-09 7:45
harold aptroot8-Jun-09 7:45 
Questionzedgraph Pin
yankoon8-Jun-09 3:06
yankoon8-Jun-09 3:06 
QuestionDynamically adding checkboxes in datagridview. Pin
deepseeindeepsy8-Jun-09 3:02
deepseeindeepsy8-Jun-09 3:02 
AnswerRe: Dynamically adding checkboxes in datagridview. Pin
yankoon8-Jun-09 3:11
yankoon8-Jun-09 3:11 
GeneralRe: Dynamically adding checkboxes in datagridview. Pin
deepseeindeepsy8-Jun-09 19:11
deepseeindeepsy8-Jun-09 19:11 
QuestionEXCEPTIONN: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed Pin
Ashwanth Sreedharan8-Jun-09 1:34
Ashwanth Sreedharan8-Jun-09 1:34 
AnswerRe: EXCEPTIONN: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed Pin
Rob Philpott8-Jun-09 2:07
Rob Philpott8-Jun-09 2:07 
AnswerRe: EXCEPTIONN: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed Pin
Ashwanth Sreedharan8-Jun-09 2:12
Ashwanth Sreedharan8-Jun-09 2:12 
QuestionHow can I know when a user clicks on Back button on top left corner of IE window using c#? Pin
svt gdwl8-Jun-09 1:10
svt gdwl8-Jun-09 1:10 
AnswerRe: How can I know when a user clicks on Back button on top left corner of IE window using c#? Pin
musefan8-Jun-09 2:03
musefan8-Jun-09 2:03 
Questionuser control design time event Pin
Abdul Rahman Hamidy8-Jun-09 0:06
Abdul Rahman Hamidy8-Jun-09 0:06 
AnswerRe: user control design time event Pin
Simon P Stevens8-Jun-09 1:03
Simon P Stevens8-Jun-09 1:03 
GeneralRe: user control design time event Pin
Abdul Rahman Hamidy14-Jun-09 19:30
Abdul Rahman Hamidy14-Jun-09 19:30 
QuestionSet a value to MDM T02 TXA-2-3 using NHapi? Pin
jingzo7-Jun-09 23:36
jingzo7-Jun-09 23:36 
AnswerRe: Set a value to MDM T02 TXA-2-3 using NHapi? Pin
jingzo10-Jun-09 23:21
jingzo10-Jun-09 23:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.