---
title: "System::Text::Json::JsonWriterHelper::EscapeString method"
url: "https://reference.aspose.com/pdf/cpp/system.text.json/jsonwriterhelper/escapestring/"
product: "Aspose.PDF for C++ API Reference"
description: "How to use EscapeString method of System::Text::Json::JsonWriterHelper class in C++."
---

## JsonWriterHelper::EscapeString(ReadOnlySpan\<char16_t\>, Span\<char16_t\>, int32_t, System::SharedPtr\<Encodings::Web::JavaScriptEncoder\>, int32_t\&, int32_t\&, bool) method




```cpp
static void System::Text::Json::JsonWriterHelper::EscapeString(ReadOnlySpan<char16_t> value, Span<char16_t> destination, int32_t indexOfFirstByteToEscape, System::SharedPtr<Encodings::Web::JavaScriptEncoder> encoder, int32_t &consumed, int32_t &written, bool isFinalBlock=true)
```

## See Also

* Class [ReadOnlySpan](../../../system/readonlyspan/)
* Class [Span](../../../system/span/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [JavaScriptEncoder](../../../system.text.encodings.web/javascriptencoder/)
* Class [JsonWriterHelper](../)
* Namespace [System::Text::Json](../../)
* Library [Aspose.PDF for C++](../../../)
## JsonWriterHelper::EscapeString(ReadOnlySpan\<char16_t\>, Span\<char16_t\>, int32_t, System::SharedPtr\<Encodings::Web::JavaScriptEncoder\>, int32_t\&) method




```cpp
static void System::Text::Json::JsonWriterHelper::EscapeString(ReadOnlySpan<char16_t> value, Span<char16_t> destination, int32_t indexOfFirstByteToEscape, System::SharedPtr<Encodings::Web::JavaScriptEncoder> encoder, int32_t &written)
```

## See Also

* Class [ReadOnlySpan](../../../system/readonlyspan/)
* Class [Span](../../../system/span/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [JavaScriptEncoder](../../../system.text.encodings.web/javascriptencoder/)
* Class [JsonWriterHelper](../)
* Namespace [System::Text::Json](../../)
* Library [Aspose.PDF for C++](../../../)
## JsonWriterHelper::EscapeString(ReadOnlySpan\<uint8_t\>, Span\<uint8_t\>, int32_t, System::SharedPtr\<Encodings::Web::JavaScriptEncoder\>, int32_t\&, int32_t\&, bool) method




```cpp
static void System::Text::Json::JsonWriterHelper::EscapeString(ReadOnlySpan<uint8_t> value, Span<uint8_t> destination, int32_t indexOfFirstByteToEscape, System::SharedPtr<Encodings::Web::JavaScriptEncoder> encoder, int32_t &consumed, int32_t &written, bool isFinalBlock=true)
```

## See Also

* Class [ReadOnlySpan](../../../system/readonlyspan/)
* Class [Span](../../../system/span/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [JavaScriptEncoder](../../../system.text.encodings.web/javascriptencoder/)
* Class [JsonWriterHelper](../)
* Namespace [System::Text::Json](../../)
* Library [Aspose.PDF for C++](../../../)
## JsonWriterHelper::EscapeString(ReadOnlySpan\<uint8_t\>, Span\<uint8_t\>, int32_t, System::SharedPtr\<Encodings::Web::JavaScriptEncoder\>, int32_t\&) method




```cpp
static void System::Text::Json::JsonWriterHelper::EscapeString(ReadOnlySpan<uint8_t> value, Span<uint8_t> destination, int32_t indexOfFirstByteToEscape, System::SharedPtr<Encodings::Web::JavaScriptEncoder> encoder, int32_t &written)
```

## See Also

* Class [ReadOnlySpan](../../../system/readonlyspan/)
* Class [Span](../../../system/span/)
* Typedef [SharedPtr](../../../system/sharedptr/)
* Class [JavaScriptEncoder](../../../system.text.encodings.web/javascriptencoder/)
* Class [JsonWriterHelper](../)
* Namespace [System::Text::Json](../../)
* Library [Aspose.PDF for C++](../../../)
