473,396 Members | 2,018 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,396 software developers and data experts.

Fastest string manipulation object

Hi,

Whats is the fastest object type or method that can be used for high
performance string manipulations. I have heard stringbuilder does. But does
any body know anything better.

My operation are simple.. this is what I need to do with a least performance
hit.

//_consoleMsg = new StringBuilder(message);

StringBuilder _consoleMsg = new StringBuilder();

// The below section will be called many times.

_consoleMsg.Append(message);

_consoleWindow.Console.Text = _consoleMsg.ToString();

Thanks

Amendra
Jul 21 '05 #1
3 1312
Hi,

StringBuilder is quite a good choice for your problem.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Amendra" <am*****@virtusa.com> wrote in message
news:uq**************@TK2MSFTNGP11.phx.gbl...
Hi,

Whats is the fastest object type or method that can be used for high
performance string manipulations. I have heard stringbuilder does. But does any body know anything better.

My operation are simple.. this is what I need to do with a least performance hit.

//_consoleMsg = new StringBuilder(message);

StringBuilder _consoleMsg = new StringBuilder();

// The below section will be called many times.

_consoleMsg.Append(message);

_consoleWindow.Console.Text = _consoleMsg.ToString();

Thanks

Amendra

Jul 21 '05 #2
Amendra,

I think that you should do neither. If all you are doing is displaying
the and don't have a need to store everything, then I would recommend
calling the AppendText method on the TextBox and appending the text to your
textbox using that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amendra" <am*****@virtusa.com> wrote in message
news:uq**************@TK2MSFTNGP11.phx.gbl...
Hi,

Whats is the fastest object type or method that can be used for high
performance string manipulations. I have heard stringbuilder does. But does any body know anything better.

My operation are simple.. this is what I need to do with a least performance hit.

//_consoleMsg = new StringBuilder(message);

StringBuilder _consoleMsg = new StringBuilder();

// The below section will be called many times.

_consoleMsg.Append(message);

_consoleWindow.Console.Text = _consoleMsg.ToString();

Thanks

Amendra

Jul 21 '05 #3
Each time you AppendText it redisplays the text and re-allocates its
internal buffer. Serious performance issue. Stick to StringBuilder().
Thanks,
Shawn

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:O9**************@tk2msftngp13.phx.gbl...
Amendra,

I think that you should do neither. If all you are doing is displaying the and don't have a need to store everything, then I would recommend
calling the AppendText method on the TextBox and appending the text to your textbox using that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Amendra" <am*****@virtusa.com> wrote in message
news:uq**************@TK2MSFTNGP11.phx.gbl...
Hi,

Whats is the fastest object type or method that can be used for high
performance string manipulations. I have heard stringbuilder does. But

does
any body know anything better.

My operation are simple.. this is what I need to do with a least

performance
hit.

//_consoleMsg = new StringBuilder(message);

StringBuilder _consoleMsg = new StringBuilder();

// The below section will be called many times.

_consoleMsg.Append(message);

_consoleWindow.Console.Text = _consoleMsg.ToString();

Thanks

Amendra


Jul 21 '05 #4

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

Similar topics

11
by: Simon | last post by:
Hi, If I have a string, (variable len), and I am looking for the first position of one char in array starting from position 'x' For example, // the 'haystack' $string = "PHP is great,...
3
by: Amendra | last post by:
Hi, Whats is the fastest object type or method that can be used for high performance string manipulations. I have heard stringbuilder does. But does any body know anything better. My...
11
by: hoopsho | last post by:
Hi Everyone, I am trying to write a program that does a few things very fast and with efficient use of memory... a) I need to parse a space-delimited file that is really large, upwards fo a...
14
by: Mark Broadbent | last post by:
Does anybody know what is (factual please -not just guess) the quickest method to read data from a file? I am not interested in the format of the data (i.e. blocks, bytes, string etc) just that the...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
7
Frinavale
by: Frinavale | last post by:
I currently have a .NET application that has an object which passes a string (a connection string) as a parameter to another object that does database manipulation. This string isn't stored...
3
by: ommail | last post by:
Hi I wonder if regular expressions are in general sower than using classes like String and Char when used for validating/parsing text data? I've done some simple test (using IsMatch()) method...
12
by: Godzilla | last post by:
Hello, I'm trying to find a way to convert an integer (8-bits long for starters) and converting them to a list, e.g.: num = 255 numList = with the first element of the list being the...
24
by: ThunderMusic | last post by:
Hi, The subject says it all... I want to use a byte and use it as byte* so I can increment the pointer to iterate through it. What is the fastest way of doing so in C#? Thanks ThunderMusic
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.