vb.net - Parser not recognizing a dash -
my program makes calculations on physics vectors , allows copy/pasting websites , tries parse them x, y, , z components automatically. i've come across 1 website (http://mathinsight.org/cross_product_examples) has (3,−3,1). while looks normal, minus not recognized vb. visually, longer normal minus (− , -), return same unicode of 45. picture shows unicode every character (i added minus in front of first 3 comparison) in textbox. also, website, had use ctrl+c because right clicking shows not simple html.
one valid (the first), second gives vb fits shown below. either won't compile (shown blue line below) or simple assignment (the second one) wrecks havok on form.
i have tried using
vectorstring.replace("–", "-")
and pasting in longer dash target string , normal keystroke dash replacement, nothing happens. i'm guessing since both have same unicode.
is there way convert longer, invalid dash 1 recognized vb? tried using dash symbol word likes replace minus sign , comes unicode 150. so, apparently there @ least 3 different kinds of dashes. thoughts?
the character math insight u+2212, minus sign. character tried using in replace
call u+2013, en dash. that's why replace didn't work.
beyond standard ascii hyphen (-, u+0045), there 2 common dashes: en dash (–, u+2013) , em dash (—, u+2014). there figure dash (‒, u+2012), not common.
Comments
Post a Comment