Update docs to reflect new behavior of delete function taking array in second argument
This commit is contained in:
parent
69c42b7eef
commit
f6e20d2068
2 changed files with 40 additions and 37 deletions
|
@ -148,7 +148,7 @@ strings; for example, 'hello\n' becomes 'hello'. Requires a single string or arr
|
||||||
*Type*: rvalue
|
*Type*: rvalue
|
||||||
|
|
||||||
* `delete`: Deletes all instances of a given element from an array, substring from a
|
* `delete`: Deletes all instances of a given element from an array, substring from a
|
||||||
string, or key from a hash. For example, `delete(['a','b','c','b'], 'b')` returns ['a','c']; `delete('abracadabra', 'bra')` returns 'acada'. *Type*: rvalue
|
string, or key from a hash. For example, `delete(['a','b','c','b'], 'b')` returns ['a','c']; `delete('abracadabra', 'bra')` returns 'acada'. `delete({'a' => 1,'b' => 2,'c' => 3},['b','c'])` returns {'a'=> 1} *Type*: rvalue
|
||||||
|
|
||||||
* `delete_at`: Deletes a determined indexed value from an array. For example, `delete_at(['a','b','c'], 1)` returns ['a','c']. *Type*: rvalue
|
* `delete_at`: Deletes a determined indexed value from an array. For example, `delete_at(['a','b','c'], 1)` returns ['a','c']. *Type*: rvalue
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@ string, or key from a hash.
|
||||||
delete({'a'=>1,'b'=>2,'c'=>3}, 'b')
|
delete({'a'=>1,'b'=>2,'c'=>3}, 'b')
|
||||||
Would return: {'a'=>1,'c'=>3}
|
Would return: {'a'=>1,'c'=>3}
|
||||||
|
|
||||||
|
delete({'a'=>1,'b'=>2,'c'=>3}, ['b','c'])
|
||||||
|
Would return: {'a'=>1}
|
||||||
|
|
||||||
delete('abracadabra', 'bra')
|
delete('abracadabra', 'bra')
|
||||||
Would return: 'acada'
|
Would return: 'acada'
|
||||||
EOS
|
EOS
|
||||||
|
|
Loading…
Reference in a new issue