System.JSON.Utils.TJsonTextUtils
Delphi
TJsonTextUtils = class
C++
class PASCALIMPLEMENTATION TJsonTextUtils : public System::TObject
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | System.JSON.Utils.pas System.JSON.Utils.hpp |
System.JSON.Utils | System.JSON.Utils |
Description
Provides methods that can be useful when you use the JSON API.
TJsonTextUtils provides the following methods:
- IsWhiteSpace determines if a given string is composed exclusively of characters that are considered white space.
- ShouldEscapeJavaScriptString determines if a string has a character that you must escape.
- ToCharAsUnicode generates a Unicode escape sequence for a given character.
- WriteEscapedString generates a JSON string from a regular string.
Character Escaping Flags
One of the parameters of ShouldEscapeJavaScriptString and WriteEscapedString (CharEscapeFlags
) is an array of character escaping flags.
Each character escaping flag is a boolean value that indicates whether the character that it represents must be escaped (True
) or not (False
). Each flag represents the character that has an ordinal value equal to the index of the flag in the array. For example, if the array has 128 flags, each flag represents one of the ASCII characters.
TJsonTextUtils provides some predefined arrays of character escaping flags that you can use:
TJsonTextUtils Property | Escaped Characters |
---|---|
| |
| |
|