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

string concatination problem

I've an ArrayList with the the values shown below:

[0]: "ComputerServices"
[1]: "Documents"
[2]: "BIG Folder"

I want to turn the arraylist into ComputerServices/Documents/BIG Folder/

Here is what i am doing..

for(int i=0; i < arrPath.Count; i++)
{
FilePath +=arrPath[i].ToString()+"/";
}

The problem i have is i am getting ComputerServices/Documents/BIG
from FilePath variable.. anything after the space is not added.. why?

Many thanks
Jul 21 '05 #1
2 1713
How is the arraylist being populated? Can you show that code?

Jul 21 '05 #2
huzz <hu**@discussions.microsoft.com> wrote:
I've an ArrayList with the the values shown below:

[0]: "ComputerServices"
[1]: "Documents"
[2]: "BIG Folder"

I want to turn the arraylist into ComputerServices/Documents/BIG Folder/

Here is what i am doing..

for(int i=0; i < arrPath.Count; i++)
{
FilePath +=arrPath[i].ToString()+"/";
}

The problem i have is i am getting ComputerServices/Documents/BIG
from FilePath variable.. anything after the space is not added.. why?


My guess is that you're looking in the debugger, and the value isn't
actually a space, but a Unicode null character (0).

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

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

Similar topics

37
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
2
by: HumanJHawkins | last post by:
The following query works perfectly (returning all words on a list called "Dolch" that do not contain a form of "doing"): SELECT 'Dolch' AS , dbo.Dolch.vchWord FROM dbo.Dolch LEFT OUTER JOIN...
5
by: Alpha | last post by:
Is there any way to create a new column in a dataset table from 2 string column and a int column? I got an error "expecting string" from my code below. Any help would be appreciated. ...
2
by: Boni | last post by:
Hi all, String *A="kkkj" String *B="kkkj" Is there something easier then String *C=String::Concat(A,B) Why can't it just be as in C# C=A+B. Thanks, Boni
8
by: Two Beards | last post by:
Hi, I'm new to VB and .net so I may be mising something. I am trying to dynamically build some SQL by appending to a string. Part of the SQL comes from an mp3 id tag I have extracted from a file...
23
by: Bonj | last post by:
what is the correct form of string concatenation in VB.NET, + or &? Both seem to work, but which is correct? I know it's + in C# and & in VB6, but which in VB.NET?
2
by: huzz | last post by:
I've an ArrayList with the the values shown below: : "ComputerServices" : "Documents" : "BIG Folder" I want to turn the arraylist into ComputerServices/Documents/BIG Folder/ Here is what i...
16
by: Mark A. Sam | last post by:
Hello, I am having a problem with imputting into a string variable: Dim strSQL As String = "INSERT INTO tblContactForm1 (txtName, txtCompany, txtPhone, txtEmail, txtComment, chkGrower,...
0
by: pradeep | last post by:
Hello, I have problem in PHP String concatination with html select combo box. There are 3 files addressbook.sql : concat1.php concat2.php
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: 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...
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...
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...

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.