String.Concat メソッド (String, String, String, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Public Shared Function Concat ( _ str0 As String, _ str1 As String, _ str2 As String, _ str3 As String _ ) As String
Dim str0 As String Dim str1 As String Dim str2 As String Dim str3 As String Dim returnValue As String returnValue = String.Concat(str0, str1, str2, str3)
public static function Concat ( str0 : String, str1 : String, str2 : String, str3 : String ) : String
- str0
第 1 の String。
- str3
第 4 の String。
str0、str1、str2、および str3 の連結結果。


この Concat メソッドを使用して、DataBinding オブジェクトの出力を生成する例については、次のコード例を参照してください。
myDataBindingCollection = DataBindings myEnumerator = myDataBindingCollection.GetEnumerator() While myEnumerator.MoveNext() myDataBinding2 = CType(myEnumerator.Current, DataBinding) Dim dataBindingOutput1, dataBindingOutput2, dataBindingOutput3 As [String] dataBindingOutput1 = [String].Concat("The property name is ", myDataBinding2.PropertyName) dataBindingOutput2 = [String].Concat("The property type is ", myDataBinding2.PropertyType.ToString(), "-", dataBindingOutput1) dataBindingOutput3 = [String].Concat("The expression is ", myDataBinding2.Expression, "-", dataBindingOutput2) WriteToFile(dataBindingOutput3) myDataBindingExpression2 = [String].Concat("<%#", myDataBinding2.Expression, "%>") myStringReplace2 = myDataBinding2.PropertyName.Replace(".", "-") myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2, True) Dim index As Integer = myStringReplace2.IndexOf("-"c) End While ' while loop ends
myDataBindingCollection = DataBindings; myEnumerator = myDataBindingCollection.GetEnumerator(); while(myEnumerator.MoveNext()) { myDataBinding2 = (DataBinding)myEnumerator.Current; String dataBindingOutput1,dataBindingOutput2,dataBindingOutput3; dataBindingOutput1=String.Concat("The property name is ",myDataBinding2.PropertyName); dataBindingOutput2=String.Concat("The property type is ",myDataBinding2.PropertyType.ToString() ,"-",dataBindingOutput1); dataBindingOutput3=String.Concat("The expression is ",myDataBinding2.Expression ,"-",dataBindingOutput2); WriteToFile(dataBindingOutput3); myDataBindingExpression2 = String.Concat("<%#",myDataBinding2.Expression ,"%>"); myStringReplace2 = myDataBinding2.PropertyName.Replace(".","-"); myHtmlControlDesignBehavior.SetAttribute(myStringReplace2,myDataBindingExpression2 ,true); int index = myStringReplace2.IndexOf('-'); }// while loop ends
myDataBindingCollection = get_DataBindings(); myEnumerator = myDataBindingCollection.GetEnumerator(); while (myEnumerator.MoveNext()) { myDataBinding2 = (DataBinding)(myEnumerator.get_Current()); String dataBindingOutput1, dataBindingOutput2, dataBindingOutput3; dataBindingOutput1 = String.Concat("The property name is ", myDataBinding2.get_PropertyName()); dataBindingOutput2 = String.Concat("The property type is ", myDataBinding2.get_PropertyType().ToString(), "-", dataBindingOutput1); dataBindingOutput3 = String.Concat("The expression is ", myDataBinding2.get_Expression(), "-", dataBindingOutput2); WriteToFile(dataBindingOutput3); myDataBindingExpression2 = String.Concat("<%#", myDataBinding2.get_Expression(), "%>"); myStringReplace2 = myDataBinding2.get_PropertyName(). Replace(".", "-"); myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2, true); int index = myStringReplace2.IndexOf("-"); } // while loop ends

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド

名前 | 説明 |
---|---|
String.Concat (Object) | 指定したオブジェクトの String 形式を作成します。 .NET Compact Framework によってサポートされています。 |
String.Concat (Object[]) | 指定した Object 配列の要素の String 形式を連結します。 .NET Compact Framework によってサポートされています。 |
String.Concat (String[]) | 指定した String 配列の要素を連結します。 .NET Compact Framework によってサポートされています。 |
String.Concat (Object, Object) | 指定した 2 つのオブジェクトの String 形式を連結します。 .NET Compact Framework によってサポートされています。 |
String.Concat (String, String) | 指定した 2 つの String インスタンスを連結します。 .NET Compact Framework によってサポートされています。 |
String.Concat (Object, Object, Object) | 指定した 3 つのオブジェクトの String 形式を連結します。 .NET Compact Framework によってサポートされています。 |
String.Concat (String, String, String) | 指定した 3 つの String インスタンスを連結します。 .NET Compact Framework によってサポートされています。 |
String.Concat (Object, Object, Object, Object) | 4 つの指定したオブジェクトと、オプションの可変長パラメータ リストで指定した任意のオブジェクトの String 表現を連結します。 |
String.Concat (String, String, String, String) | 指定した 4 つの String インスタンスを連結します。 .NET Compact Framework によってサポートされています。 |

String.Concat メソッド (String[])
アセンブリ: mscorlib (mscorlib.dll 内)

Dim values As String() Dim returnValue As String returnValue = String.Concat(values)
戻り値
連結された values の要素。



Concat メソッドを String 配列と共に使用する方法については、次のコード例を参照してください。
Imports System Public Class ConcatTest Public Shared Sub Main() Dim s As String() = {"hello ", "and ", "welcome ", "to ", "this ", "demo! "} ' make an array of strings. Note that we have included spaces ' put all the strings together Console.WriteLine(String.Concat(s)) ' sort the strings, and put them together Array.Sort(s) Console.WriteLine(String.Concat(s)) End Sub 'Main End Class 'ConcatTest
using System; public class ConcatTest { public static void Main() { // make an array of strings. Note that we have included spaces string [] s = { "hello ", "and ", "welcome ", "to ", "this ", "demo! " }; // put all the strings together Console.WriteLine(string.Concat(s)); // sort the strings, and put them together Array.Sort(s); Console.WriteLine(string.Concat(s)); } }
using namespace System; int main() { // make an array of strings. Note that we have included spaces array<String^>^s = {"hello ","and ","welcome ","to ","this ","demo! "}; // put all the strings together Console::WriteLine( String::Concat( s ) ); // sort the strings, and put them together Array::Sort( s ); Console::WriteLine( String::Concat( s ) ); }
import System.*; public class ConcatTest { public static void main(String[] args) { // make an array of strings. Note that we have included spaces String s[] = { "hello ", "and ", "welcome ", "to ", "this ", "demo! " }; // put all the strings together Console.WriteLine(String.Concat(s)); // sort the strings, and put them together Array.Sort(s); Console.WriteLine(String.Concat(s)); } //main } //ConcatTest
import System; public class ConcatTest { public static function Main() : void { // make an array of strings. Note that we have included spaces var s : String [] = [ "hello ", "and ", "welcome ", "to ", "this ", "demo! "]; // put all the strings together Console.WriteLine(System.String.Concat(s)); // sort the strings, and put them together System.Array.Sort(s); Console.WriteLine(System.String.Concat(s)); } } ConcatTest.Main();

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (Object, Object, Object, Object)
アセンブリ: mscorlib (mscorlib.dll 内)

<CLSCompliantAttribute(False)> _ Public Shared Function Concat ( _ arg0 As Object, _ arg1 As Object, _ arg2 As Object, _ arg3 As Object _ ) As String
Dim arg0 As Object Dim arg1 As Object Dim arg2 As Object Dim arg3 As Object Dim returnValue As String returnValue = String.Concat(arg0, arg1, arg2, arg3)
[CLSCompliantAttribute(false)] public static string Concat ( Object arg0, Object arg1, Object arg2, Object arg3 )
[CLSCompliantAttribute(false)] public: static String^ Concat ( Object^ arg0, Object^ arg1, Object^ arg2, Object^ arg3 )
/** @attribute CLSCompliantAttribute(false) */ public static String Concat ( Object arg0, Object arg1, Object arg2, Object arg3 )
CLSCompliantAttribute(false) public static function Concat ( arg0 : Object, arg1 : Object, arg2 : Object, arg3 : Object ) : String
- arg0
第 1 の Object。
- arg1
第 2 の Object。
- arg3
第 4 の Object。
arg0、arg1、arg2、および arg3 の各パラメータの String 形式の値の連結結果。

Empty 文字列は、任意の null 引数の代わりに使用されます。
![]() |
---|
Concat メソッドの最後のパラメータは、連結する 1 つ以上の追加オブジェクトを含むオプションのコマンド区切りリストです。 |

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (String, String, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim str0 As String Dim str1 As String Dim str2 As String Dim returnValue As String returnValue = String.Concat(str0, str1, str2)
- str0
第 1 の String。
str0、str1、および str2 の連結結果。


この Concat メソッドを使用して、コンソールへの出力を生成する例については、次のコード例を参照してください。
Option Explicit Option Strict Imports System Imports System.Globalization Public Class MainClass Public Shared Sub Main() Dim dt As DateTime = DateTime.Now Dim myformat() As String = {"d", "D", _ "f", "F", _ "g", "G", _ "m", _ "r", _ "s", _ "t", "T", _ "u", "U", _ "y", _ "dddd, MMMM dd yyyy", _ "ddd, MMM d ""'""yy", _ "dddd, MMMM dd", _ "M/yy", _ "dd-MM-yy"} Dim mydate As String Dim i As Integer For i = 0 To myformat.Length - 1 mydate = dt.ToString(myformat(i), DateTimeFormatInfo.InvariantInfo) Console.WriteLine(String.Concat(myformat(i), " :", mydate)) Next i ' Output. ' ' d :08/17/2000 ' D :Thursday, August 17, 2000 ' f :Thursday, August 17, 2000 16:32 ' F :Thursday, August 17, 2000 16:32:32 ' g :08/17/2000 16:32 ' G :08/17/2000 16:32:32 ' m :August 17 ' r :Thu, 17 Aug 2000 23:32:32 GMT ' s :2000-08-17T16:32:32 ' t :16:32 ' T :16:32:32 ' u :2000-08-17 23:32:32Z ' U :Thursday, August 17, 2000 23:32:32 ' y :August, 2000 ' dddd, MMMM dd yyyy :Thursday, August 17 2000 ' ddd, MMM d "'"yy :Thu, Aug 17 '00 ' dddd, MMMM dd :Thursday, August 17 ' M/yy :8/00 ' dd-MM-yy :17-08-00 End Sub 'Main End Class 'MainClass
using System; using System.Globalization; public class MainClass { public static void Main(string[] args) { DateTime dt = DateTime.Now; String[] format = { "d", "D", "f", "F", "g", "G", "m", "r", "s", "t", "T", "u", "U", "y", "dddd, MMMM dd yyyy", "ddd, MMM d \"'\"yy", "dddd, MMMM dd", "M/yy", "dd-MM-yy", }; String date; for (int i = 0; i < format.Length; i++) { date = dt.ToString(format[i], DateTimeFormatInfo.InvariantInfo); Console.WriteLine(String.Concat(format[i], " :" , date)); } /** Output. * * d :08/17/2000 * D :Thursday, August 17, 2000 * f :Thursday, August 17, 2000 16:32 * F :Thursday, August 17, 2000 16:32:32 * g :08/17/2000 16:32 * G :08/17/2000 16:32:32 * m :August 17 * r :Thu, 17 Aug 2000 23:32:32 GMT * s :2000-08-17T16:32:32 * t :16:32 * T :16:32:32 * u :2000-08-17 23:32:32Z * U :Thursday, August 17, 2000 23:32:32 * y :August, 2000 * dddd, MMMM dd yyyy :Thursday, August 17 2000 * ddd, MMM d "'"yy :Thu, Aug 17 '00 * dddd, MMMM dd :Thursday, August 17 * M/yy :8/00 * dd-MM-yy :17-08-00 */ } }
using namespace System; using namespace System::Globalization; void main() { DateTime dt = DateTime::Now; array<String^>^format = {L"d",L"D",L"f",L"F",L"g",L"G",L"m",L"r",L"s",L"t",L"T",L"u",L"U",L"y",L"dddd, MMMM dd yyyy",L"ddd, MMM d \"'\"yy",L"dddd, MMMM dd",L"M/yy",L"dd-MM-yy"}; String^ date; for ( int i = 0; i < format->Length; i++ ) { date = dt.ToString( format[ i ], DateTimeFormatInfo::InvariantInfo ); Console::WriteLine( String::Concat( format[ i ], L" :", date ) ); } /** Output. * * d :08/17/2000 * D :Thursday, August 17, 2000 * f :Thursday, August 17, 2000 16:32 * F :Thursday, August 17, 2000 16:32:32 * g :08/17/2000 16:32 * G :08/17/2000 16:32:32 * m :August 17 * r :Thu, 17 Aug 2000 23:32:32 GMT * s :2000-08-17T16:32:32 * t :16:32 * T :16:32:32 * u :2000-08-17 23:32:32Z * U :Thursday, August 17, 2000 23:32:32 * y :August, 2000 * dddd, MMMM dd yyyy :Thursday, August 17 2000 * ddd, MMM d "'"yy :Thu, Aug 17 '00 * dddd, MMMM dd :Thursday, August 17 * M/yy :8/00 * dd-MM-yy :17-08-00 */ }
import System.*; import System.Globalization.*; public class MainClass { public static void main(String[] args) { DateTime dT = DateTime.get_Now(); String format[] = { "d", "D", "f", "F", "g", "G", "m", "r", "s", "t", "T", "u", "U", "y", "dddd, MMMM dd yyyy", "ddd, MMM d \"'\"yy", "dddd, MMMM dd", "M/yy", "dd-MM-yy" }; String date; for (int i = 0; i < format.get_Length(); i++) { date = dT.ToString(format[i], DateTimeFormatInfo.get_InvariantInfo()); Console.WriteLine(String.Concat(format[i], " :", date)); } } //main } //MainClass /** Output. * * d :08/17/2000 * D :Thursday, August 17, 2000 * f :Thursday, August 17, 2000 16:32 * F :Thursday, August 17, 2000 16:32:32 * g :08/17/2000 16:32 * G :08/17/2000 16:32:32 * m :August 17 * r :Thu, 17 Aug 2000 23:32:32 GMT * s :2000-08-17T16:32:32 * t :16:32 * T :16:32:32 * u :2000-08-17 23:32:32Z * U :Thursday, August 17, 2000 23:32:32 * y :August, 2000 * dddd, MMMM dd yyyy :Thursday, August 17 2000 * ddd, MMM d "'"yy :Thu, Aug 17 '00 * dddd, MMMM dd :Thursday, August 17 * M/yy :8/00 * dd-MM-yy :17-08-00 */
import System; import System.Globalization; var dt : DateTime = DateTime.Now; var format : String[] = [ "d", "D", "f", "F", "g", "G", "m", "r", "s", "t", "T", "u", "U", "y", "dddd, MMMM dd yyyy", "ddd, MMM d \"'\"yy", "dddd, MMMM dd", "M/yy", "dd-MM-yy", ]; var date : String; for (var i : int = 0; i < format.Length; i++) { date = dt.ToString(format[i], DateTimeFormatInfo.InvariantInfo); Console.WriteLine(format[i] + " :" + date); } /** Output. * * d :08/17/2000 * D :Thursday, August 17, 2000 * f :Thursday, August 17, 2000 16:32 * F :Thursday, August 17, 2000 16:32:32 * g :08/17/2000 16:32 * G :08/17/2000 16:32:32 * m :August 17 * r :Thu, 17 Aug 2000 23:32:32 GMT * s :2000-08-17T16:32:32 * t :16:32 * T :16:32:32 * u :2000-08-17 23:32:32Z * U :Thursday, August 17, 2000 23:32:32 * y :August, 2000 * dddd, MMMM dd yyyy :Thursday, August 17 2000 * ddd, MMM d "'"yy :Thu, Aug 17 '00 * dddd, MMMM dd :Thursday, August 17 * M/yy :8/00 * dd-MM-yy :17-08-00 */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (String, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim str0 As String Dim str1 As String Dim returnValue As String returnValue = String.Concat(str0, str1)
- str0
第 1 の String。
str0 と str1 の連結結果。


個人の名前の、名、ミドル ネーム、姓を連結する方法については、次のコード例を参照してください。
Imports System Public Class ConcatTest Public Shared Sub Main() Dim fName As String = "Simon" Dim mName As String = "Jake" Dim lName As String = "Harrows" ' we want to simply quickly add this person's name together ' because we want a name to appear with a space in between each name, ' put a space on the front of the middle, and last name, allowing for ' the fact that a space may already be there mName = " " + mName.Trim() lName = " " + lName.Trim() ' this line simply concatenates the two strings Console.WriteLine("Welcome to this page, '{0}'!", String.Concat(String.Concat(fName, mName), lName)) End Sub 'Main End Class 'ConcatTest
using System; public class ConcatTest { public static void Main() { // we want to simply quickly add this person's name together string fName = "Simon"; string mName = "Jake"; string lName = "Harrows"; // because we want a name to appear with a space in between each name, // put a space on the front of the middle, and last name, allowing for // the fact that a space may already be there mName = " " + mName.Trim(); lName = " " + lName.Trim(); // this line simply concatenates the two strings Console.WriteLine("Welcome to this page, '{0}'!", string.Concat( string.Concat(fName, mName), lName ) ); } }
using namespace System; int main() { // we want to simply quickly add this person's name together String^ fName = "Simon"; String^ mName = "Jake"; String^ lName = "Harrows"; // because we want a name to appear with a space in between each name, // put a space on the front of the middle, and last name, allowing for // the fact that a space may already be there mName = String::Concat( " ", mName->Trim() ); lName = String::Concat( " ", lName->Trim() ); // this line simply concatenates the two strings Console::WriteLine( "Welcome to this page, '{0}'!", String::Concat( String::Concat( fName, mName ), lName ) ); }
import System.*; public class ConcatTest { public static void main(String[] args) { // we want to simply quickly add this person's name together String fName = "Simon"; String mName = "Jake"; String lName = "Harrows"; // because we want a name to appear with a space in between each name, // put a space on the front of the middle, and last name, allowing for // the fact that a space may already be there mName = " " + mName.Trim(); lName = " " + lName.Trim(); // this line simply concatenates the two strings Console.WriteLine("Welcome to this page, '{0}'!", String.Concat(String.Concat(fName, mName), lName)); } //main } //ConcatTest

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (Object, Object, Object)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim arg0 As Object Dim arg1 As Object Dim arg2 As Object Dim returnValue As String returnValue = String.Concat(arg0, arg1, arg2)
- arg0
第 1 の Object。
- arg1
第 2 の Object。
arg0、arg1、およびarg2 の String 形式の値の連結結果。


Imports System Imports Microsoft.VisualBasic _ Class stringConcat5 Public Shared Sub Main() Dim i As Integer = - 123 Dim o As [Object] = i Dim objs() As [Object] = {- 123, - 456, - 789} Console.WriteLine("Concatenate 1, 2, and 3 objects:") Console.WriteLine("1) {0}", [String].Concat(o)) Console.WriteLine("2) {0}", [String].Concat(o, o)) Console.WriteLine("3) {0}", [String].Concat(o, o, o)) Console.WriteLine(vbCrLf & "Concatenate 4 objects and a variable length parameter list:") Console.WriteLine("4) {0}", [String].Concat(o, o, o, o, o)) Console.WriteLine(vbCrLf & "Concatenate a 3 element object array:") Console.WriteLine("5) {0}", [String].Concat(objs)) End Sub 'Main End Class 'stringConcat5 ' 'This example produces the following output: 'Concatenate 1, 2, and 3 objects: '1) -123 '2) -123-123 '3) -123-123-123 ' 'Concatenate 4 objects and a variable length parameter list: '4) -123-123-123-123-123 ' 'Concatenate a 3 element object array: '5) -123-456-789 '
using System; class stringConcat5 { public static void Main() { int i = -123; Object o = i; Object[] objs = new Object[] {-123, -456, -789}; Console.WriteLine("Concatenate 1, 2, and 3 objects:"); Console.WriteLine("1) {0}", String.Concat(o)); Console.WriteLine("2) {0}", String.Concat(o, o)); Console.WriteLine("3) {0}", String.Concat(o, o, o)); Console.WriteLine("\nConcatenate 4 objects and a variable length parameter list:"); Console.WriteLine("4) {0}", String.Concat(o, o, o, o, o)); Console.WriteLine("\nConcatenate a 3 element object array:"); Console.WriteLine("5) {0}", String.Concat(objs)); } } /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */
using namespace System; int main() { int i = -123; Object^ o = i; array<Object^>^objs = { -123, -456, -789}; Console::WriteLine( "Concatenate 1, 2, and 3 objects:" ); Console::WriteLine( "1) {0}", String::Concat( o ) ); Console::WriteLine( "2) {0}", String::Concat( o, o ) ); Console::WriteLine( "3) {0}", String::Concat( o, o, o ) ); Console::WriteLine( "\nConcatenate 4 objects and a variable length parameter list:" ); Console::WriteLine( "4) {0}", String::Concat( o, o, o, o, o ) ); Console::WriteLine( "\nConcatenate a 3 element object array:" ); Console::WriteLine( "5) {0}", String::Concat( objs ) ); } /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */
import System.*; class StringConcat5 { public static void main(String[] args) { int i = -123; Object o = (Int32)i; Object objs[] = new Object[] { (Int32)(-123), (Int32)(-456), (Int32)(-789) }; Console.WriteLine("Concatenate 1, 2, and 3 objects:"); Console.WriteLine("1) {0}", String.Concat(o)); Console.WriteLine("2) {0}", String.Concat(o, o)); Console.WriteLine("3) {0}", String.Concat(o, o, o)); Console.WriteLine("\nConcatenate 4 objects and a variable length " + "parameter list:"); Object objArr[] = { o, o, o, o, o }; Console.WriteLine("4) {0}", String.Concat(objArr)); Console.WriteLine("\nConcatenate a 3 element object array:"); Console.WriteLine("5) {0}", String.Concat(objs)); } //main } //StringConcat5 /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (Object[])
アセンブリ: mscorlib (mscorlib.dll 内)

Dim args As Object() Dim returnValue As String returnValue = String.Concat(args)
戻り値
args の要素の String 形式の値の連結結果。



Concat メソッドを Object 配列と共に使用する方法については、次のコード例を参照してください。
Imports System Public Class ConcatTest Public Shared Sub Main() Dim t1 As New Test1() Dim t2 As New Test2() Dim i As Integer = 16 Dim s As String = "Demonstration" Dim o As Object() = {t1, i, t2, s} ' create a group of objects ' place the objects in an array ' concatenate the objects together as a string. To do this, ' the ToString method in the objects is called Console.WriteLine(String.Concat(o)) End Sub 'Main End Class 'ConcatTest ' imagine these test classes are full-fledged objects... Class Test1 End Class 'Test1 Class Test2 End Class 'Test2
using System; public class ConcatTest { public static void Main() { // create a group of objects Test1 t1 = new Test1(); Test2 t2 = new Test2(); int i = 16; string s = "Demonstration"; // place the objects in an array object [] o = { t1, i, t2, s }; // concatenate the objects together as a string. To do this , // the ToString method in the objects is called Console.WriteLine(string.Concat(o)); } } // imagine these test classes are full-fledged objects... class Test1 { } class Test2 { }
using namespace System; // imagine these test classes are full-fledged objects... ref class Test1{}; ref class Test2{}; int main() { // create a group of objects Test1^ t1 = gcnew Test1; Test2^ t2 = gcnew Test2; int i = 16; String^ s = "Demonstration"; // place the objects in an array array<Object^>^o = {t1,i,t2,s}; // concatenate the objects together as a string. To do this, // the ToString method in the objects is called Console::WriteLine( String::Concat( o ) ); }
import System.*; public class ConcatTest { public static void main(String[] args) { // create a group of objects Test1 t1 = new Test1(); Test2 t2 = new Test2(); int i = 16; String s = "Demonstration"; // place the objects in an array Object o[] = { t1, (Int32)i, t2, s }; // concatenate the objects together as a string. To do this , // the ToString method in the objects is called Console.WriteLine(String.Concat(o)); } //main } //ConcatTest // imagine these test classes are full-fledged objects... class Test1 { } //Test1 class Test2 { } //Test2

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (Object, Object)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim arg0 As Object Dim arg1 As Object Dim returnValue As String returnValue = String.Concat(arg0, arg1)
- arg0
第 1 の Object。
- arg1
第 2 の Object。
arg0 と arg1 の String 形式の値の連結結果。

Empty 文字列は、任意の null 引数の代わりに使用されます。
どちらかの引数が配列参照である場合、このメソッドでは、その配列のメンバではなく、その配列を表す文字列形式を連結します (たとえば "System.String[]")。

Imports System Imports Microsoft.VisualBasic _ Class stringConcat5 Public Shared Sub Main() Dim i As Integer = - 123 Dim o As [Object] = i Dim objs() As [Object] = {- 123, - 456, - 789} Console.WriteLine("Concatenate 1, 2, and 3 objects:") Console.WriteLine("1) {0}", [String].Concat(o)) Console.WriteLine("2) {0}", [String].Concat(o, o)) Console.WriteLine("3) {0}", [String].Concat(o, o, o)) Console.WriteLine(vbCrLf & "Concatenate 4 objects and a variable length parameter list:") Console.WriteLine("4) {0}", [String].Concat(o, o, o, o, o)) Console.WriteLine(vbCrLf & "Concatenate a 3 element object array:") Console.WriteLine("5) {0}", [String].Concat(objs)) End Sub 'Main End Class 'stringConcat5 ' 'This example produces the following output: 'Concatenate 1, 2, and 3 objects: '1) -123 '2) -123-123 '3) -123-123-123 ' 'Concatenate 4 objects and a variable length parameter list: '4) -123-123-123-123-123 ' 'Concatenate a 3 element object array: '5) -123-456-789 '
using System; class stringConcat5 { public static void Main() { int i = -123; Object o = i; Object[] objs = new Object[] {-123, -456, -789}; Console.WriteLine("Concatenate 1, 2, and 3 objects:"); Console.WriteLine("1) {0}", String.Concat(o)); Console.WriteLine("2) {0}", String.Concat(o, o)); Console.WriteLine("3) {0}", String.Concat(o, o, o)); Console.WriteLine("\nConcatenate 4 objects and a variable length parameter list:"); Console.WriteLine("4) {0}", String.Concat(o, o, o, o, o)); Console.WriteLine("\nConcatenate a 3 element object array:"); Console.WriteLine("5) {0}", String.Concat(objs)); } } /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */
using namespace System; int main() { int i = -123; Object^ o = i; array<Object^>^objs = { -123, -456, -789}; Console::WriteLine( "Concatenate 1, 2, and 3 objects:" ); Console::WriteLine( "1) {0}", String::Concat( o ) ); Console::WriteLine( "2) {0}", String::Concat( o, o ) ); Console::WriteLine( "3) {0}", String::Concat( o, o, o ) ); Console::WriteLine( "\nConcatenate 4 objects and a variable length parameter list:" ); Console::WriteLine( "4) {0}", String::Concat( o, o, o, o, o ) ); Console::WriteLine( "\nConcatenate a 3 element object array:" ); Console::WriteLine( "5) {0}", String::Concat( objs ) ); } /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */
import System.*; class StringConcat5 { public static void main(String[] args) { int i = -123; Object o = (Int32)i; Object objs[] = new Object[] { (Int32)(-123), (Int32)(-456), (Int32)(-789) }; Console.WriteLine("Concatenate 1, 2, and 3 objects:"); Console.WriteLine("1) {0}", String.Concat(o)); Console.WriteLine("2) {0}", String.Concat(o, o)); Console.WriteLine("3) {0}", String.Concat(o, o, o)); Console.WriteLine("\nConcatenate 4 objects and a variable length " + "parameter list:"); Object objArr[] = { o, o, o, o, o }; Console.WriteLine("4) {0}", String.Concat(objArr)); Console.WriteLine("\nConcatenate a 3 element object array:"); Console.WriteLine("5) {0}", String.Concat(objs)); } //main } //StringConcat5 /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


String.Concat メソッド (Object)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim arg0 As Object Dim returnValue As String returnValue = String.Concat(arg0)
- arg0
Object または null 参照 (Visual Basic では Nothing)。
String 形式での arg0 の値。


Imports System Imports Microsoft.VisualBasic _ Class stringConcat5 Public Shared Sub Main() Dim i As Integer = - 123 Dim o As [Object] = i Dim objs() As [Object] = {- 123, - 456, - 789} Console.WriteLine("Concatenate 1, 2, and 3 objects:") Console.WriteLine("1) {0}", [String].Concat(o)) Console.WriteLine("2) {0}", [String].Concat(o, o)) Console.WriteLine("3) {0}", [String].Concat(o, o, o)) Console.WriteLine(vbCrLf & "Concatenate 4 objects and a variable length parameter list:") Console.WriteLine("4) {0}", [String].Concat(o, o, o, o, o)) Console.WriteLine(vbCrLf & "Concatenate a 3 element object array:") Console.WriteLine("5) {0}", [String].Concat(objs)) End Sub 'Main End Class 'stringConcat5 ' 'This example produces the following output: 'Concatenate 1, 2, and 3 objects: '1) -123 '2) -123-123 '3) -123-123-123 ' 'Concatenate 4 objects and a variable length parameter list: '4) -123-123-123-123-123 ' 'Concatenate a 3 element object array: '5) -123-456-789 '
using System; class stringConcat5 { public static void Main() { int i = -123; Object o = i; Object[] objs = new Object[] {-123, -456, -789}; Console.WriteLine("Concatenate 1, 2, and 3 objects:"); Console.WriteLine("1) {0}", String.Concat(o)); Console.WriteLine("2) {0}", String.Concat(o, o)); Console.WriteLine("3) {0}", String.Concat(o, o, o)); Console.WriteLine("\nConcatenate 4 objects and a variable length parameter list:"); Console.WriteLine("4) {0}", String.Concat(o, o, o, o, o)); Console.WriteLine("\nConcatenate a 3 element object array:"); Console.WriteLine("5) {0}", String.Concat(objs)); } } /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */
using namespace System; int main() { int i = -123; Object^ o = i; array<Object^>^objs = { -123, -456, -789}; Console::WriteLine( "Concatenate 1, 2, and 3 objects:" ); Console::WriteLine( "1) {0}", String::Concat( o ) ); Console::WriteLine( "2) {0}", String::Concat( o, o ) ); Console::WriteLine( "3) {0}", String::Concat( o, o, o ) ); Console::WriteLine( "\nConcatenate 4 objects and a variable length parameter list:" ); Console::WriteLine( "4) {0}", String::Concat( o, o, o, o, o ) ); Console::WriteLine( "\nConcatenate a 3 element object array:" ); Console::WriteLine( "5) {0}", String::Concat( objs ) ); } /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */
import System.*; class StringConcat5 { public static void main(String[] args) { int i = -123; Object o = (Int32)i; Object objs[] = new Object[] { (Int32)(-123), (Int32)(-456), (Int32)(-789) }; Console.WriteLine("Concatenate 1, 2, and 3 objects:"); Console.WriteLine("1) {0}", String.Concat(o)); Console.WriteLine("2) {0}", String.Concat(o, o)); Console.WriteLine("3) {0}", String.Concat(o, o, o)); Console.WriteLine("\nConcatenate 4 objects and a variable length " + "parameter list:"); Object objArr[] = { o, o, o, o, o }; Console.WriteLine("4) {0}", String.Concat(objArr)); Console.WriteLine("\nConcatenate a 3 element object array:"); Console.WriteLine("5) {0}", String.Concat(objs)); } //main } //StringConcat5 /* This example produces the following output: Concatenate 1, 2, and 3 objects: 1) -123 2) -123-123 3) -123-123-123 Concatenate 4 objects and a variable length parameter list: 4) -123-123-123-123-123 Concatenate a 3 element object array: 5) -123-456-789 */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


StringConcat プロパティ
StringConcat メソッド

名前 | 説明 | |
---|---|---|
![]() | Clear | |
![]() | Concat | |
![]() | Equals | オーバーロードされます。 ( ValueType から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( ValueType から継承されます。) |
![]() | GetResult | |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | このインスタンスの完全修飾型名を返します。 ( ValueType から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

StringConcat メンバ
StringConcat データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Clear | |
![]() | Concat | |
![]() | Equals | オーバーロードされます。 ( ValueType から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (ValueType から継承されます。) |
![]() | GetResult | |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | このインスタンスの完全修飾型名を返します。 (ValueType から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

StringConcat 構造体
アセンブリ: System.Data.SqlXml (system.data.sqlxml.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- String.Concatのページへのリンク