跳轉到內容

Rebol 程式設計/find

來自華夏公益教科書,開放的書籍,為開放的世界
FIND series value /part range /only /case /any /with wild /skip size /match /tail /last /reverse 

在系列中查詢值並返回該值開始處的系列。

FIND 是一個動作值。

  • series -- (型別:系列物件埠位集)
  • value -- (型別:任何型別)
  • /part -- 將搜尋限制為給定長度或位置。
    • range -- (型別:數字系列埠)
  • /only -- 將系列值視為單個值。
  • /case -- 字元區分大小寫。
  • /any -- 啟用 * 和  ? 萬用字元。
  • /with -- 允許自定義萬用字元。
    • wild -- 指定 * 和  ? 的備選方案 (型別:字串)
  • /skip -- 將系列視為固定大小的記錄
    • size -- (型別:整數)
  • /match -- 執行比較並返回匹配的尾部。
  • /tail -- 返回字串的末尾。
  • /last -- 從字串末尾反向。
  • /reverse -- 從當前位置反向。

原始碼

[編輯 | 編輯原始碼]
find: native[
    {Finds a value in a series and returns the series at the start of it.} 
    series [series! object! port! bitset!] 
    value [any-type!] 
    /part "Limits the search to a given length or position." 
    range [number! series! port!] 
    /only "Treats a series value as a single value." 
    /case "Characters are case-sensitive." 
    /any "Enables the * and ? wildcards." 
    /with "Allows custom wildcards." 
    wild [string!] "Specifies alternates for * and ?" 
    /skip "Treat the series as records of fixed size" 
    size [integer!] 
    /match {Performs comparison and returns the tail of the match.} 
    /tail "Returns the end of the string." 
    /last "Backwards from end of string." 
    /reverse "Backwards from the current position."
]
華夏公益教科書