「C#」StringのConcatメソッドで文字列を結合する

書式
public static String Concat(String str0, String str1, String str2);
StringクラスのConcatメソッドです。
指定された文字列を文字列の最後に連結します。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
using System;
using System.Text;
class Strdemo
{
static void Main()
{
string strA = "テスト";
string strB = "太郎";
double gg = 56.78;
string result = String.Concat(strA, strB,gg);
Console.WriteLine(result);
}
}
using System; using System.Text; class Strdemo { static void Main() { string strA = "テスト"; string strB = "太郎"; double gg = 56.78; string result = String.Concat(strA, strB,gg); Console.WriteLine(result); } }
using System;
using System.Text;
class Strdemo
{
      static void Main()
      {
            string strA = "テスト";
            string strB = "太郎";
        double  gg = 56.78;

          string result = String.Concat(strA, strB,gg);
            Console.WriteLine(result); 

      }
}

実行結果
テスト太郎56.78

C#

Posted by arkgame