Changeset 706
- Timestamp:
- Jun 28, 2009, 2:23:39 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/String.ab
r676 r706 607 607 End Function 608 608 609 Static Function Join(separator As String, strings As System.Collections.Generic. List<String>) As String609 Static Function Join(separator As String, strings As System.Collections.Generic.IList<String>) As String 610 610 Return Join(separator, strings, 0, strings.Count) 611 611 End Function 612 612 613 Static Function Join(separator As String, strings As System.Collections.Generic.List<String>, startIndex As Long, count As Long) As String 614 If (startIndex+count > strings.Count) or (startIndex < 0) or (count < 1) Then 613 Static Function Join(separator As String, strings As System.Collections.Generic.IList<String>, startIndex As Long, count As Long) As String 614 If ObjPtr(strings) = NULL Then ' IsNothingだとエラーになる 615 Throw New ArgumentNullException("strings") 616 ElseIf (startIndex+count > strings.Count) or (startIndex < 0) or (count < 0) Then 615 617 Throw New ArgumentOutOfRangeException("String.Join: One or more arguments are out of range value.", "startIndex or count") 616 618 End If 617 619 618 Dim string As String 619 Dim i As Long 620 For i = startIndex To startIndex + count - 2 621 string += strings[i] + separator 622 Next 623 Return string + strings[i] 620 If count = 0 Then 621 Return "" 622 Else 623 Dim string As String 624 Dim i As Long 625 For i = startIndex To startIndex + count - 2 626 string += strings.Item[i] + separator 627 Next 628 Return string + strings.Item[i] 629 End If 624 630 End Function 625 631 … … 687 693 sb.Append(c, total - m_Length) 688 694 sb.Append(This) 689 Return sb.ToString 695 Return sb.ToString() 690 696 End Function 691 697 … … 704 710 sb.Append(This) 705 711 sb.Append(c, total - m_Length) 706 Return sb.ToString 712 Return sb.ToString() 707 713 End Function 708 714 Private
Note:
See TracChangeset
for help on using the changeset viewer.