string concatination problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.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
 
huzz said:
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.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.
 
Back
Top