ConvertedString = System::Web::HttpUtility::HtmlEncode(SomeString); ConvertedString = System::Web::HttpUtility::UrlEncode(SomeString); If its not available select project proiperties > Framework & References > add a reference to System.Web HtmlEncode – HTML encoding makes sure that text is displayed correctly in the browser and not interpreted by the browser as HTML. UrlEncode – Encodes a URL string. These method overloads can be used to encode […]
Category: Strings
Value Internationalization Issues
Comma Instead Of Decimal Point In countries such as Germany they use commas as decimal points (e.g. -0,136222). So if your program is converting a string like this: String ^sTemp; Single Value; sTemp = “1.234”; Value = Convert::ToSingle(sTemp); What you will actually get is 1234 in Value – the decimal point is ignored. Correctly Handling […]
Working With Characters In Strings
Replace A Character In A String sTemp = “ABCDEF”; sTemp = sTemp->Substring(1, 1); //Get a single character from the source string Result = Result->Remove(LICENSER_PRODUCT_ID_1_INDEX, 1); //Remove the character to be replaced in the destination string Result = Result->Insert(LICENSER_PRODUCT_ID_1_INDEX, sTemp); //Add the character
Working With Strings
String Special Characters sTemp += "\r\n" //Add a newline String ^sTemp = = "\x7"; // ‘\x’ means ‘0x’ and the 1 of 2 digits that follow are a hex value for the character requried newline( LF) \n horizontal tab (TAB) \t vertical tab \v backspace \b carriage return (CR) \r formfeed \f alert (bell) \a […]