Hi what character is this in blue, I am trying to right logic to replace the question mark from a text file i am importing, can someone help me
(1.10 ? 1.49)
if (code.Contains('?'))
{
//Replaces a symbol character which comes over as '?' representing a dash with a real dash ('-').
code= pcodeDescription.Replace('?', '-');
cm.Parameters.AddWithValue("@code", code);
}
Loading
SenthilkumarPosted Apr 4, 2012, 2:43 AM
David SmithPosted Apr 4, 2012, 1:57 AM
David SmithPosted Apr 4, 2012, 1:50 AM
Read in the Example.txt file and what character c sharp is recognizing the character as (1.10 – 1.49) , when I read the file in code, i see the '>, i am trying to replace it with a dash. or '-'
SenthilkumarPosted Apr 4, 2012, 1:37 AM
When you use '>' like this, then it will show the too many literals.
What you need to do is replace the ' quote by ".
It works, check it and let me know.
David SmithPosted Apr 4, 2012, 1:29 AM
if (code.Contains('?'))
{
//Replaces a symbol character which comes over as '?' representing a dash with a real dash ('-').
code= code.Replace('?', '-');
cm.Parameters.AddWithValue("@code", code);
}
SenthilkumarPosted Apr 4, 2012, 12:08 AM
What ever you have written the logic is correct.
But you are not replacing the "-" from the correct variable.
Working code here: