前提・実現したいこと
Visual C#では使えていたString.JoinメソッドがUnityのC#で書くとエラーになってしまいます。
ご教示お願い致します。
該当のソースコード
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4using System.Linq; 5using System; 6 7public class Test : MonoBehaviour { 8 9 // Use this for initialization 10 void Start () { 11 List<int> list = new List<int> { 1, 2, 3, 4, 5 }; 12 IEnumerable<int> result = list.Where(item => item % 2 == 0); 13 Debug.Log(String.Join(",", result); 14 } 15 16 // Update is called once per frame 17 void Update () { 18 19 } 20}
・エラーメッセージ。
error CS1502: The best overloaded method match for `string.Join(string, string[])' has some invalid arguments error CS1503: Argument `#2' cannot convert `System.Collections.Generic.IEnumerable<int>' expression to type `string[]'
試したこと
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/09/13 15:52