Skip to content

JsonPathManager.Remove(string path) Method

Shuzhao Feng edited this page Jan 24, 2024 · 2 revisions

Definition

Remove a value or child from the JsonPathManager tree, then return the removed value(s).

Method Signature

JsonPathManager.Remove(string path);

Returns

A JToken object containing all values removed from the root, null if nothing has been removed due to value does not exist at the path specified.

If multiple values at different locations were removed (e.g. due to the path contains an index span or multiple indexes at a level), the removed values will be put into a JArray and the array will be returned.

Usage

JsonPathManager instance = new JsonPathManager();

instance.Remove("$.path.to.location");

Parameters

path : string

The path to the location where the value should be removed.

Supported Path Syntax

See JsonPathSerializer Supported Paths.

Supported Versions

v0.1.2 and above
  • v0.3.0
  • v0.2.0
  • v0.1.2

Clone this wiki locally