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

Split stringbuilder in array

Hi,

How can I split a stringbuilder into arrays?

Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on index
0 "234567" and on index 1 "test1".

How can I do this?

Thanks!
Nov 17 '05 #1
3 15901
Arjen <bo*****@hotmail.com> wrote:
How can I split a stringbuilder into arrays?

Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on index
0 "234567" and on index 1 "test1".


What's meant to determine where the string is split? I suggest you call
ToString and then Substring...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
KH
You could loop thru each character in the Stringbuilder and fill each array
based on the current index in the loop.

Or you could call .ToString() on the stringbuilder and use the IndexOf or
Substring or whatever String functions you needed.
"Arjen" wrote:
Hi,

How can I split a stringbuilder into arrays?

Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on index
0 "234567" and on index 1 "test1".

How can I do this?

Thanks!

Nov 17 '05 #3
You can't split a Stringubilder. You CAN split the string it builds. The
string it builds can easily be obtained by calling ToString() on the
StringBuilder. Then you can chop it up anyway you like.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Arjen" <bo*****@hotmail.com> wrote in message
news:di**********@news3.zwoll1.ov.home.nl...
Hi,

How can I split a stringbuilder into arrays?

Let's say I have a stringbuilder with this value "test1234567".
Now I want an array with size 6. The value of the array have to be on
index 0 "234567" and on index 1 "test1".

How can I do this?

Thanks!

Nov 17 '05 #4

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

Similar topics

7
by: brianshields | last post by:
array("a", "b", "c", "d", "e"); I want to now be able to load "b" into a variable ($var) then print it out print $var thanks!
3
by: Tome73 | last post by:
How would I convert this string to an Array? "243, 567, 324, 345" Where each number becomes a new element in that Array. Thanks
5
by: chrisgeary | last post by:
i have a function (below) which reads the last n lines from a text file. rather than read the whole line and output it as is, i want to be able to read the line and split the tab delimited text...
17
by: AMP | last post by:
Hello I get 2 errors in the following code that I cant Debug without some help. They are both in the TryParse function. Seems simple enough.The Errors are Below. private void...
5
by: kumarboston | last post by:
Hi All, I fetched a sequence from my database into mysql_query and then I want to split in the group of 60 and print it. I am using while loop and pushing into array and then trying to split it and...
5
kaleeswaran
by: kaleeswaran | last post by:
Hi! i stored the string value inside my array like "1,username" so i have to split the value user name and serial number. the array is: for(index=0; index < data.length;...
7
by: ricardoramoscabral | last post by:
Hello to All. I have this array of strings: char str = {" comp " Hello World " "}; And i whant to split in two arrays from the original: ( { <----- str1 ------- "<---str2 -------->"...
2
by: AMP | last post by:
Hello, I am trying to split an Array into another array. Each value in the array has tab delimited strings. I am getting: Cannot implicitly convert type 'string' to 'string' I am trying...
13
by: pereges | last post by:
I've an array : {100,20, -45 -345, -2 120, 64, 99, 20, 15, 0, 1, 25} I want to split it into two different arrays such that every number <= 50 goes into left array and every number 50 goes...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...

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.