Microsoft
Software
Hardware
Network
Question : Fastest way to count how much , I have in string variable with C#
Hi experts!
I’m developing application WinForm on NETFramework 2 with C#. I have a string valuable which can be:
S=”234”;
S=”234,456,456”;
I need to find faster way to count how much are , in this string. It should be as fast as possible as this action is in loop. Please help.
Answer : Fastest way to count how much , I have in string variable with C#
int i = 0;
if(s.Contains(","))
{
int i = string.Split(",").Length - 1;
}
Random Solutions
Mac Mail only shows 90 days of deleted items
Built-In Webcam Stopped Working on Lenovo ThinkPad
Sort Mysql table with recent entries
How to refer dynamically to specific pages in Indesign CS2
Server 2008 R2 - Can Connect to Server By IP, but not computer name
Design issue, storing date from /proc
SUP7203B PFC incompatibility
Problem with file name comparison in unix script
open Firmware
Offline address book cannot be downloaded after moving mailbox to exchange 2010