Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi to all,

 

I'm currently making a app that has to read 2 files and combine it all in one. The information is layout in lines. Something like this

 

000222333 23222323 Street number 27 6700-200

003343344 34556324 The Mall 24 5400-200

000003322 32233233 Street Hólând 33 3432-233

 

So i go through the lines and take the information. That easy because i have the position of each information so i can take it with Substring. Something like this

 


string value = string.Empty;

StreamReader sr = new StreamReader(@"C:\File.txt");
string sLineApolices = null;

while((sLineApolices = srApolices.ReadLine()) != null)
{
    value = sline.Substring(25, 38);
}

 

in this example i take the street name. All is fine except, as you can see, the last street name has an accentuated character "Street Hólând".

 

This is where the problem is. It appears that substring method skips this characters. So in this case value has this information

Street Hlnd 3

 

How can i make it recognize these character?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...