###前提・実現したいこと
正規表現をつかわずに指定した文字列に特定の文字列があるか判定するプログラム(作成中)。
###発生している問題・エラーメッセージ
Assets/script/SaveScript.cs(28,17): error CS0029: Cannot implicitly convert type `int' to `bool'
###該当のソースコード
using UnityEngine; using UnityEngine.UI; using System.Collections; public class SaveScript : MonoBehaviour { string str; string before; string after; public InputField inputField; public Text text; public Text talk; int i; void Start () { talk.text = "はじめまして私unity、私とおしゃべりしませんか?"; } public void SaveText () { str = inputField.text; text.text = str; before = str; string[] stArrayData = {"こんにちは", "おはよう", ""}; string[] hennji = {"こんにちは!", "おはよう!", ""}; for(i =0 ;i = 10000;i++) { after = before.Replace(stArrayData[i], ""); if (before == after) { }else{ talk.text = hennji [i]; } } inputField.text = ""; } }

回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/17 11:35