c# - Create a numeric value from text -
c# - Create a numeric value from text -
i have searched allot on google without results looking for
i numeric value string in c#
ex.
var mystring = "oompa loompa"; var numericoutput = convertstringtonumericvalue(mystring);
output/value of numericoutput
612734818
so when set in string allow "c4rd1ff internat!onal @ gr3at place#"
int output 73572753
.
the values must remain constant, illustration if come in same text 1 time again of "oompa loompa"
612734818
again.
i thought maybe in way of using font family
char index of each character, don't know start this.
the reason can utilize number generate index out of string other info in it, , same input string, same index 1 time again recall final output string validation.
any help or point in right direction appreciated
thanks tim
ended doing following:
var inputstring = "my test string ~!@#$%^&*()_+{}:<>?|"; byte[] asciibytes = encoding.ascii.getbytes(inputstring); int multiplier = 1; int sum = 0; foreach (byte b in asciibytes) { sum += ((int)b) * multiplier; multiplier++; }
obviously not work 1000's of characters, plenty short words or sentences
int.maxvalue = 2 147 483 647
c# string integer numerical-methods
Comments
Post a Comment