Index: trunk/Include/Classes/System/String.ab
===================================================================
--- trunk/Include/Classes/System/String.ab	(revision 428)
+++ trunk/Include/Classes/System/String.ab	(revision 457)
@@ -27,5 +27,5 @@
 
 	Class String
-	'	Inherits IComparable, ICloneable, IConvertible, IEnumerable
+		Implements /*IComparable, ICloneable, IConvertible, IComparable<String>, IEnumerable, IEnumerable<StrChar>, IEquatable<String>*/
 
 		m_Length As Long
@@ -34,9 +34,7 @@
 		Sub validPointerCheck(p As VoidPtr, size = 1 As Long)
 			If p As ULONG_PTR < &h10000 Then
-				'Throw ArgumentException
-				Debug
+				Throw New ArgumentException
 			ElseIf IsBadReadPtr(p, size As ULONG_PTR) Then
-				'Throw ArgumentException
-				Debug
+				Throw New ArgumentException
 			End If
 		End Sub
@@ -153,49 +151,49 @@
 
 		Const Function Operator == (y As String) As Boolean
-			Return String.Compare(This, y) = 0
+			Return Compare(This, y) = 0
 		End Function
 
 		Const Function Operator == (y As *StrChar) As Boolean
-			Return String.Compare(This, y) = 0
+			Return Compare(This, y) = 0
 		End Function
 
 		Const Function Operator <> (y As String) As Boolean
-			Return String.Compare(This, y) <> 0
+			Return Compare(This, y) <> 0
 		End Function
 
 		Const Function Operator <> (y As *StrChar) As Boolean
-			Return String.Compare(This, y) <> 0
+			Return Compare(This, y) <> 0
 		End Function
 
 		Const Function Operator < (y As String) As Boolean
-			Return String.Compare(This, y) < 0
+			Return Compare(This, y) < 0
 		End Function
 
 		Const Function Operator < (y As *StrChar) As Boolean
-			Return String.Compare(This, y) < 0
+			Return Compare(This, y) < 0
 		End Function
 
 		Const Function Operator > (y As String) As Boolean
-			Return String.Compare(This, y) > 0
+			Return Compare(This, y) > 0
 		End Function
 
 		Const Function Operator > (y As *StrChar) As Boolean
-			Return String.Compare(This, y) > 0
+			Return Compare(This, y) > 0
 		End Function
 
 		Const Function Operator <= (y As String) As Boolean
-			Return String.Compare(This, y) <= 0
+			Return Compare(This, y) <= 0
 		End Function
 
 		Const Function Operator <= (y As *StrChar) As Boolean
-			Return String.Compare(This, y) <= 0
+			Return Compare(This, y) <= 0
 		End Function
 
 		Const Function Operator >= (y As String) As Boolean
-			Return String.Compare(This, y) >= 0
+			Return Compare(This, y) >= 0
 		End Function
 
 		Const Function Operator >= (y As *StrChar) As Boolean
-			Return String.Compare(This, y) >= 0
+			Return Compare(This, y) >= 0
 		End Function
 
@@ -205,22 +203,24 @@
 
 	Public
+		'Compareなどで、x.Charsではなく、StrPtr(x)と書く理由は、xがNothingの場合のため。
+
 		Static Function Compare(x As String, indexX As Long, y As String, indexY As Long, length As Long) As Long
-			Return String.CompareOrdinal(x, indexX, y, indexY, length)
+			Return CompareOrdinal(x, indexX, y, indexY, length)
 		End Function
 
 		Static Function CompareOrdinal(x As String, y As String) As Long
-			Return String.CompareOrdinal(x.Chars, y.Chars)
+			Return CompareOrdinal(StrPtr(x), StrPtr(y))
 		End Function
 
 		Static Function CompareOrdinal(x As String, indexX As Long, y As String, indexY As Long, length As Long) As Long
-			Return String.CompareOrdinal(x.Chars, indexX, y.Chars, indexY, length)
+			Return CompareOrdinal(StrPtr(x), indexX, StrPtr(y), indexY, length)
 		End Function
 	Private
 		Static Function Compare(x As String, y As *StrChar) As Long
-			Return String.CompareOrdinal(x, y)
+			Return CompareOrdinal(x, y)
 		End Function
 
 		Static Function CompareOrdinal(x As String, y As *StrChar) As Long
-			Return String.CompareOrdinal(x.Chars, y)
+			Return CompareOrdinal(StrPtr(x), y)
 		End Function
 
@@ -257,5 +257,5 @@
 		Function CompareTo(y As Object) As Long
 			If Not Object.Equals(This.GetType(), y.GetType()) Then
-				Throw New ArgumentException("String.CompareTo: An argument is out of range value.", "y")
+				Throw New ArgumentException("String.CompareTo: The type of the argument y is not String.", "y")
 			End If
 			Return CompareTo(y As String)
@@ -351,6 +351,26 @@
 		End Function
 
+		Static Function Concat(x As String, y As String, z As String) As String
+			Dim sb = New Text.StringBuilder(removeNull(x).Length + removeNull(y).Length + removeNull(z).Length)
+			sb.Append(x).Append(y).Append(z)
+			Concat = sb.ToString
+		End Function
+
+		Static Function Concat(x As String, y As String, z As String, w As String) As String
+			Dim sb = New Text.StringBuilder(removeNull(x).Length + removeNull(y).Length + removeNull(z).Length + removeNull(w).Length)
+			sb.Append(x).Append(y).Append(z).Append(w)
+			Concat = sb.ToString
+		End Function
+
 		Static Function Concat(x As Object, y As Object) As String
-			Return String.Concat(x.ToString, y.ToString)
+			Return Concat(x.ToString, y.ToString)
+		End Function
+
+		Static Function Concat(x As Object, y As Object, z As Object) As String
+			Return Concat(x.ToString, y.ToString, z.ToString)
+		End Function
+
+		Static Function Concat(x As Object, y As Object, z As Object, w As Object) As String
+			Return Concat(x.ToString, y.ToString, z.ToString, w.ToString)
 		End Function
 
@@ -575,5 +595,9 @@
 			Clone = This
 		End Function
-
+/*
+		Function Clone() As Object
+			Clone = This
+		End Function
+*/
 		Static Function Copy(s As String) As String
 			Copy = New String(s.Chars, s.m_Length)
@@ -656,4 +680,12 @@
 			End If
 		End Sub
+
+		Static Function removeNull(s As String) As String
+			If ActiveBasic.IsNothing(s) Then
+				removeNull = Empty
+			Else
+				removeNull = s
+			End If
+		End Function
 	End Class
 
