Information générale
Catégorie:
Code, syntaxe and commandes
Versions des environnements
When converting from a String object to a native char form in C++, the function ".c_str()" is used ... is there some C# equivalent function that converts to some other form whereby it would all be referenced by 8-bit integers?
Also, is it possible that just for display purposes it's being shown as "\n", but in reality it's actually only one byte in the source string?
>Here's my scenario: I am storing a small number as a single character in a string. If that number happens to be 10, C# is converting it to "\n". I imagine I will run into the problem with other escape codes as well. I really need CHR(10) to be stored in the string, not "\n". I've tried Convert.ToChar(myint), (char)myint, and even went so far as to use VisualBasic.Strings.Chr(), but it always comes back as "\n" in the string. The string is later encrypted, and that's where it is really messing things up. Is there anyway to "escape the escape" and prevent this from happening?
>
>Thanks.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement