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

Manipulating at lines of StringBuilder

1) I have a variable...Dim sb as StringBuilder.
2) I assign a bunch of lines to sb.
3) I can get all the text back as a string with sb.ToString.

My question is how can I programatically update the various lines in
sb? For example, let's say that I want to add 2 spaces to the
beginning of every line in sb. Is there a way to do this easily? I
don't see a way to even read the individual lines in sb, never mind
add text to beginning of each.
Jan 18 '08 #1
1 1826
On Thu, 17 Jan 2008 19:42:53 -0800 (PST), BobRoyAce
<br**@omegasoftwareinc.comwrote:
>1) I have a variable...Dim sb as StringBuilder.
2) I assign a bunch of lines to sb.
3) I can get all the text back as a string with sb.ToString.

My question is how can I programatically update the various lines in
sb? For example, let's say that I want to add 2 spaces to the
beginning of every line in sb. Is there a way to do this easily? I
don't see a way to even read the individual lines in sb, never mind
add text to beginning of each.
If you are doing a lot of modifications you might be better off using
a List(Of String) with each line an entry in the list. That makes
modifying entries very easy. When you are finished you can put the
entries in the list into a StringBuilder.
Jan 18 '08 #2

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

Similar topics

3
by: PawelR | last post by:
Hello Group, I have very simple question. In my application I have textBox (tbInfo) where tbInfo.Multiline = true; How simple add lines to this component? Sametime I need add first, sametime last...
10
by: Segfahlt | last post by:
I have a fairly simple C# program that just needs to open up a fixed width file, convert each record to tab delimited and append a field to the end of it. The input files are between 300M and...
2
by: m00nm0nkey | last post by:
Ok well i thought i'd try a different approach, so what I'm now trying is appending 50,000 lines from the collection to a stringbuilder, and then writing that entire stringbuilder to a file. ...
3
by: retsam | last post by:
All, I'm working on an ASP.NET 2.0 (C#) page and have a question on how to build a string that includes line feeds (new lines) that displays properly on an ASP.NET page. Here's what I got: ...
3
by: ad | last post by:
I have set a TextBox to MultiLines and set the rows to 10. I assigned the Text of the TextBox some lins of text at desgin time, but only the first line remain in the TextBox. How can I assign...
5
by: Justin Fancy | last post by:
Hi everyone, I need some help. I'm placing text files into a created database using vb.Net. The problem is that, i need two seperate sql statements to add both files because they are in...
15
by: d4 | last post by:
I have a vbscript (below) I want to rewrite in C# but I cannot get it to work (unless there is a better way to do it). The script will combine 2 lines if the (next) line contains a "+",...
3
by: pbd22 | last post by:
Hi. I have an event handler in VB.NET that gets called several times. The output of the event handler is XML that is being called by an xmlhttp request from the client. I am using a...
3
by: Peeyush81 | last post by:
Hi, I have created a win32 dll with an exported method. extern "C" __declspec(dllexport) void LocateAddress(struct stLocateAddressParam arrAddressParam,int nClientType, LPTSTR outptr); In...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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...

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.