473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Nov 15 '05 #1
3 1416
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

Nov 15 '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

Nov 15 '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


Nov 15 '05 #4

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

Similar topics

11
2511
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
1315
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
3585
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
9069
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
14761
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...
15
12250
by: Buddy Home | last post by:
Hello, I'm trying to speed up a piece of code that is causing performance issues with our product. The problem is we are using serialization to convert the object to a string, this is costing us...
7
2084
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
2276
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
5044
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
2264
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
7202
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
7084
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
7328
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...
1
6991
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
7458
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
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.