vb.net - PCL-compatible Chr and Asc in VB? -
I am porting an old VB code base in a PCL-compatible format. I have been able to create new versions of things like Left and CINT, but ASC and Crowe have stumped me. The typical answer is "Microsoft Import. Visualbasicic", but it is not present in PCL.
In C # you get the Unicode value, it appears to be DirectCast in str = VB.net, but that does not work Does anyone know that using ASL and Crossover using PSL-compatible functions How to write?
The key is System.Text.ASCIIEncoding.UTF.GetString / GetBytes These two arrays work on, Therefore, before going into GetString, you have to copy a substrings (0,1) in a variable () before going to get input into my input (an int 32 in my case), byte () and getbacks. This is, of course, more complex than C # solution, where you can only enter four / integer ...
public function ASC (string as CharIn) Char = convert as integer dim C Four Character (0) = C Return Convert.ToInt32 (System.Text.ASCIIEncoding.UTF8.GetBytes (CARRA) (0)) Final Characters as Tochar (CharIn.Substring (0, 1)) Dim cAray (0) String Barre (0) = convert as a function CH (as NumIn integer) byte dim as AxString as String Dim Bayer (0). ToByte (NumIn) AscString = System.Text.ASCIIEncoding.UTF8.GetString (bArray) Back AscString End Function
Comments
Post a Comment