Qurak

KeyValuePattern

ใช้งานได้

Pattern object matching an association or list of rules that contains the given key-value rules (order-independent subset)

KeyValuePattern[{patt1, …}]
Replace[<|a -> 1, b -> 2, c -> 3|>, KeyValuePattern[{a -> x_, c -> y_}] -> {x, y}] → {1, 3}ReplaceAll[<|a -> 1, b -> 2, c -> 3|>, KeyValuePattern[{x_ -> 1}] :> x] → a

หัวข้อ

ที่เกี่ยวข้อง

ฟังก์ชันทั้งหมด 6300 รายการ · ใช้สิ่งนี้จากไคลเอนต์ MCP