<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # \_List Class 1. 是一個**靜態類**, 不提供構造器 2. 主要包含對于數組的各種增強操作, 包括但不限于 排序, 數組替換, 指定范圍復制, 去重統計 3. \_List 和\_Lists 區別在于參數, 傳入的參數,如果是二維以上那么屬于,\_Lists, 否則屬于\_List 4. 提供一些測試用數組 ## 域 Field - static RNameList:=["Chris","Joe","Marcy","Chris","Elina","Timothy","Joe","Joe","Joe"] - static LetterList:=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] - static NumberList:=["1","2","3","4","5","6","7","8","9","0"] - static TheList1:=["List1"] - static TheList2:=["List2"] - static ObjList:=[List1,List2,List2,List2,List1,List1] ## 內部類 + Class AA,BB,CC,DD + 連續繼承的四個內部類:CC繼承DD,BB繼承CC,AA繼承BB + 主要目的在于測試 Analyze()等,類繼承關系分析函數。 ## 方法 ### Uniq(List) **StrList去重:** 2019年01月08日 - 這個去重方法是靠寫入 Key-Value,一開始我猜 key 不能是 Obj ,后來才知道錯了。那么這個方法就是通用的,特此改正。 #### 參數 Parameters: - List- 輸入的數組 #### 返回 Returns: NewList #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey ;字符串數組去重 NameList:=["Chris","Joe","Marcy","Chris","Elina","Timothy","Joe","Joe","Joe"] NewNameList:=_List.Uniq(NameList) ``` ```autohotkey ;Obj 數組 去重 List1:=["1"] List2:=["2"] Lists:=[List1,List2,List2,List2,List1,List1] NewLists:=_List.Uniq(Lists) ``` #### From [@Jim U](https://stackoverflow.com/users/4695439/jim-u) https://stackoverflow.com/questions/46432447/how-do-i-remove-duplicates-from-an-autohotkey-array ### StrReplace(StrList,SearchText,ReplaceText,isRegEx:=false) **字符串數組內的替換:** #### 參數 Parameters: - StrList: 輸入的字符串數組 - SearchText: 被替換文本 - ReplaceText: 替換文本 - isRegEx: true 代表正則模式, 處于"正則模式"時,SearchText 為正則表達式。 #### 返回 Returns: null #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey ;示例 List:=["123321","123456","ABC123"] _List.StrReplace(List,"3","×") ``` ### Sort(StrList, Order="A") **對數組進行排序, 支持順序, 倒序, 逆序:** #### 參數 Parameters - StrList: 輸入的字符串數組 (數字或英文字符串) - Order: 排列順序 A: 順序 D: 倒序 R: 逆序 #### 返回 Returns: null #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey ;排列數字List InputList:=[] ;生成10個偽隨機數,寫入InputList loop,10{ Random,OutputVar,0,999 InputList[A_Index]:=OutputVar } _List.sort(InputList) ``` ```autohotkey ;數字和英文混排 InputList:=["5","99","Enter","CapsLock","G","Apple"] _List.sort(InputList) ``` #### From https://sites.google.com/site/ahkref/custom-functions/sortarray_ ### Remove(List,IndexList) **按照Index批量移除數組中的元素:** #### 參數 Parameters: - List - 輸入的數組 - IndexList - 被移除元素 Index 的 List #### 返回 Returns: null #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey ;示例 List:=["Chris","Joe","Marcy","Chris","Elina","Timothy","Joe","Joe","Joe"] IndexList:=["8","6","1","2"] _List.Remove(List,IndexList) ``` ### ElementCounter(List) **統計List中所有元素出現的次數:** 把List中所有的元素都放入一個Obj,元素是key,元素出現的次數是value #### 參數 Parameters: - List- 輸入的數組 #### 返回 Returns: 關聯數組 #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey ;StrList示例 NameList:=["Chris","Joe","Marcy","Chris","Elina","Timothy","Joe","Joe","Joe"] NewObj:=_List.ElementCounter(NameList) ``` ```autohotkey ;ObjList示例 List1:=["1"],List2:=["2"],Lists:=[List1,List2,List2,List2,List1,List1] EList:=_List.ElementCounter(Lists) ``` ### CopyOfRange(List,FromIndex,ToIndex) **復制并返回數組的一部分:** #### 參數 Parameters: - List - 輸入的數組 - FromIndex - 起始Index(含) - ToIndex - 終止Index(含) #### 返回 Returns: NewList #### 拋出異常 Throws: - Exception (_EX.IndexOutOfBounds) - Exception ("FromIndex is bigger than ToIndex.") #### 示例 Example ```autohotkey ;示例 InputList:=["5","99","Enter","CapsLock","G","Apple"] FromIndex:=2,ToIndex:=4 SubList:=_List.CopyOfRange(InputList,FromIndex,ToIndex) ``` ### clone(aList) **克隆一個數組:** #### 參數 Parameters: - List - 輸入的數組 #### 返回 Returns: NewList #### 拋出異常 Throws: - Type.assert ### ToString(Str) **轉換Str數組為字符串:** #### 參數 Parameters: - Str- 輸入的字符串數組 #### 返回 Returns: TheArrayString #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey List:=_List.RNameList MsgBox,% _List.ToString(List) ``` ### merge(aList1,aList2) **合并兩個List:** #### 參數 Parameters: - aList1 - 在前方的數組 - aList2 - 在后方的數組 #### 返回 Returns: TheArray #### 拋出異常 Throws: - null #### 示例 Example ```autohotkey result := _List.merge(_List.NumberList,_List.LetterList) LogPrintln(result,A_LineFile "(" A_LineNumber ")" " : " "result >>> `r`n") ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看