473,378 Members | 1,354 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,378 software developers and data experts.

String processing improvement

I have a string variable, let say:

string s;

and I need to assign several lines to this string variable, so:

s += "rept ioruet uroeiut oirueoi uorieuto iruetoi reoituroeuti roeutoi
ureoitur oieutoire";
s += "uytuy tuytjghjlkg fhjlkghlkjhm fhm mhm gfmh mgfh rtiy triypotiry";
s += "iuygoiem,dsfdshfkewyoturen fgjfdhg kdfhgl hgjk hfdjhgk.fdagjhd agkhfd
ghd fa";
s += "reptioru eturoei utoirueoitu orieutoirue toireo uroeutir oeutoiu
reoituroie utoire";
s += "re ptiorue turoeiu toirue oituor ieutoi ruetoi reoituro eutiro eutoi
ureo ituroieu toire";

I think there might be a way to improve above processing, can anybody
provide me some suggestions?

Thanks
(Sorry, I am a newbie in C#)
Nov 17 '05 #1
1 1693
If you need to compose large strings then, from a performance perspective,
you may consider using a StringBuilder instead of a String.

--
Tim Wilson
..Net Compact Framework MVP

"Kimelia" <ka**@hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP15.phx.gbl...
I have a string variable, let say:

string s;

and I need to assign several lines to this string variable, so:

s += "rept ioruet uroeiut oirueoi uorieuto iruetoi reoituroeuti roeutoi
ureoitur oieutoire";
s += "uytuy tuytjghjlkg fhjlkghlkjhm fhm mhm gfmh mgfh rtiy triypotiry";
s += "iuygoiem,dsfdshfkewyoturen fgjfdhg kdfhgl hgjk hfdjhgk.fdagjhd agkhfd ghd fa";
s += "reptioru eturoei utoirueoitu orieutoirue toireo uroeutir oeutoiu
reoituroie utoire";
s += "re ptiorue turoeiu toirue oituor ieutoi ruetoi reoituro eutiro eutoi
ureo ituroieu toire";

I think there might be a way to improve above processing, can anybody
provide me some suggestions?

Thanks
(Sorry, I am a newbie in C#)

Nov 17 '05 #2

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

Similar topics

2
by: Techie Guy | last post by:
I'm trying to process a tab delimited file where each line in the file has around 12 tab delimited elements. My problem is the elements are surrounded by "quotes" and I need the script to remove...
12
by: Vicky | last post by:
What is the better way of checking blank string is it strvar.lenght > 0 or strvar == "" or something else Thnaks
37
by: jortizclaver | last post by:
Hi, I'm about to develop a new framework for my corporative applications and my first decision point is what kind of strings to use: std::string or classical C char*. Performance in my system...
12
by: Richard Lewis Haggard | last post by:
I thought that the whole point of StringBuilder was that it was supposed to be a faster way of building strings than string. However, I just put together a simple little application to do a...
34
by: Larry Hastings | last post by:
This is such a long posting that I've broken it out into sections. Note that while developing this patch I discovered a Subtle Bug in CPython, which I have discussed in its own section below. ...
17
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
0
by: ikogan | last post by:
The first release of the Transaction Processing over XML (TPoX) database benchmark took place last week! Please take a look at tpox.sourceforge.net. The benchmark consists of XML schemas, XML...
1
by: Xah Lee | last post by:
Text Processing with Emacs Lisp Xah Lee, 2007-10-29 This page gives a outline of how to use emacs lisp to do text processing, using a specific real-world problem as example. If you don't know...
3
by: WP | last post by:
Hello! I need some help with my program...it's supposed to read infix expressions line by line from stdin and each expression should be divided into operands and operators and added to a vector of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.