Qurak

Longest

可用,但與 .wl 參考有差異

`Longest[p]` tries the longest split of a sequence pattern first; the default

Longest[p]
{1, 2, 3} /. {Longest[x__], y__} :> {{x}, {y}} → {{1, 2}, {3}}{1, 2, 3} /. {Shortest[x__], y__} :> {{x}, {y}} → {{1}, {2, 3}}{{1, 2, 3} /. {Longest[x_], ___} :> x, MatchQ[{1, 2}, {Longest[__], _}]} → {1, True}

主題

相關

全部 6300 個函式 · 從 MCP 用戶端使用這個