lrem
1. 基本語法
lrem(key
, count
, value
)
key
, count
, value
) 刪除串列中全部或部分的value
,刪除的次數及方法取決於count
參數。
count
取值
刪除規則
count
等於0
刪除串列中所有位置的value
count
大於0
則從串列最前端開始往後依序刪除count
個value
count
小於0
則從串列最末端開始往前依序刪除|
count
|
個value
2. 範例
(1) 刪除串列中前2個A,count = 2
(2) 刪除串列中倒數2個A,count = -2
(3) 刪除串列中所有A,count = 0
Last updated
Was this helpful?