IMHO posting images is not very helpful..... So everyone that likes to try your code has to type not only your code, but also your test data.
If you had posted your data as code everyone could only copy and paste.
I don't see any problems in your code, but to check it in a small sample I have to retype it.
In addition to what Wolfgang said:
if the problem in your code is caused by an unbalanced quote, parenthesis or something like that, then it is very likely that we will not see the problem because we accidentally do not make the same mistake.
And when reading your message I have no idea what the problem is.
Are you asking for the correct syntax for the char array ?
I personally always forget that too, so I sometimes use the ToCharArray() method to get that kind of array
XSharp Development Team
Your suggested code for declaring a character array sorted me and my problem out in less than a minute - THANKS!
For those who like them, I have posted the images to show some tidied X# code which works - yes, okay, there is still some test code present, but then I am still at the development and test stage.
I took Wolfgang's comment on board about my choice of 'replaced' delimiter and its possible existence in my address book data fields. I have now changed in from '$' to '%' and I will write some 'Converter' code to trap and eliminate any entries of '%' from my data field displays. My address fields will not be allowed to have '%' included in the string input data.
The reason I chose to do a 'Replace' was because it greatly simplified the necessary string and character handling shown in sample posted on CodeProject, StackOverflow and C# Corner and the likes.
Robert, do you know of any other syntax for creating a Character array when we wish to specify a character or two at define time? I too get confused, both with Character and String arrays.
Now here are a few images of working 'stuff' :-
The full CSV record read from a file and translated / converted :-
Now the code which parses the full original CSV line (record) to make that shown above :-
And now a couple of smaller images to show that we now have 20 separate strings in the array :-
You may be interested to see that I also made stuff easier with the string handling by defining escaped small sequences, so they could be added without cause for more double quotes and assembly of the line time :-
You may have noticed that all my 20 Address Book data fields are encoded to be contained within a pair of double quotes. This just makes things easier when decoding, if it is done as shown above.
I did my homework on Wikipedia and other places, and CSV is not a perfect science, by any stretch of the imagination. I think that my test will be if my encoded files load OK into Excel, and show properly all 20 fields even with some more extreme string data encoded entered.
Hope some of this interests a few of you guys.
It looks a bit ugly, I know. But the array needs to be typed as <char>.
P.S. I'm not upset with your posting of images - it makes it only a lot harder to build a sample. Therefore I use images only when absolutely needed, and write the code directly as text - it is not so beautyful, but better to work with. And whenever needed, I add my test data and/or test application to the message.