Changeset 531
- Timestamp:
- Jun 29, 2008, 11:42:27 AM (16 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes/System
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Collections/Generic/List.ab
r526 r531 162 162 */ 163 163 Override Function ToString() As String 164 Dim object As Object165 Dim s As String166 For each object In This167 s += object.ToString() + Ex"\r\n"164 Dim string As String 165 Dim i As Long 166 For i = 0 To This.Count-2 167 string += This[i].ToString() + Ex"\r\n" 168 168 Next 169 Return s 169 Return string + This[i].ToString() 170 170 End Function 171 171 -
trunk/ab5.0/ablib/src/Classes/System/IO/Directory.ab
r431 r531 185 185 @return ファイルやディレクトリのパス文字列が列挙された配列 186 186 */ 187 Static Function GetFileSystemEnt ies(path As String) As List<String>188 Return GetFileSystemEnt ies(path, "?*")187 Static Function GetFileSystemEntries(path As String) As List<String> 188 Return GetFileSystemEntries(path, "?*") 189 189 End Function 190 190 … … 195 195 @return ファイルやディレクトリのパス文字列が列挙された配列 196 196 */ 197 Static Function GetFileSystemEnt ies(path As String, searchPattern As String) As List<String>197 Static Function GetFileSystemEntries(path As String, searchPattern As String) As List<String> 198 198 Dim info = New DirectoryInfo(path) 199 199 Dim infos = info.GetFileSystemInfos(searchPattern) As List<FileSystemInfo> -
trunk/ab5.0/ablib/src/Classes/System/String.ab
r497 r531 547 547 End Function 548 548 549 Function Split(separator As System.Collections.Generic.List<String>) As System.Collections.Generic.List<String> 550 Return Split(separator, -1, StringSplitOptions.None) 551 End Function 552 553 Function Split(separator As System.Collections.Generic.List<String>, options As StringSplitOptions) As System.Collections.Generic.List<String> 554 Return Split(separator, -1, options) 555 End Function 556 557 Function Split(separator As System.Collections.Generic.List<String>, count As Long, options As StringSplitOptions) As System.Collections.Generic.List<String> 558 Dim split As System.Collections.Generic.List<String> 559 Dim index As Long, t1Index As Long, t2Index As Long 560 Dim s As String, substring As String 561 Dim flag As Boolean 562 563 Do 564 t1Index = Length 565 flag = True 566 Foreach s In separator 567 t2Index = IndexOf(s, index) 568 If t2Index > -1 Then 569 t1Index = Math.Min(t1Index, t2Index) 570 flag = False 571 End If 572 Next 573 574 substring = Substring(index, t1Index - index) 575 If Not ( IsNullOrEmpty(substring) and (options = StringSplitOptions.RemoveEmptyEntries) ) Then 576 split.Add(substring) 577 End If 578 579 If flag Then Return split 580 If split.Count = count Then Return split 581 582 index = t1Index + 1 583 Loop 584 End Function 585 586 Static Function Join(separator As String, strings As System.Collections.Generic.List<String>) As String 587 Return Join(separator, strings, 0, strings.Count) 588 End Function 589 590 Static Function Join(separator As String, strings As System.Collections.Generic.List<String>, startIndex As Long, count As Long) As String 591 If (startIndex+count > strings.Count) or (startIndex < 0) or (count < 1) Then 592 Throw New ArgumentOutOfRangeException("String.Join: One or more arguments are out of range value.", "startIndex or count") 593 End If 594 595 Dim string As String 596 Dim i As Long 597 For i = startIndex To startIndex + count - 2 598 string += strings[i] + separator 599 Next 600 Return string + strings[i] 601 End Function 602 549 603 Const Function ToLower() As String 550 604 Dim sb = New Text.StringBuilder(m_Length) … … 669 723 End Class 670 724 725 Enum StringSplitOptions 726 None 727 RemoveEmptyEntries 728 End Enum 729 671 730 End Namespace
Note:
See TracChangeset
for help on using the changeset viewer.