脊髄反射で書いたので添削頼む。
public static string[] GetHW(string input)
{
string[] returnval = new string[2];
string[] temp = input.Split('+','-','*','/');
if (temp[0].StartsWith("w", StringComparison.Ordinal))
temp[0] = temp[0].TrimStart('w').Insert(0, "tmpW=");
else if (temp[0].StartsWith("WW", StringComparison.Ordinal))
temp[0] = "tmpW=\" \"";
else
temp[0] = "それ以外の何か";
if (temp[1].StartsWith("h", StringComparison.Ordinal))
temp[1] = temp[1].TrimStart('h').Insert(0, "tmpH=");
else if (temp[1].StartsWith("HH", StringComparison.Ordinal))
temp[1] = "tmpH=\" \"";
else
temp[1] = "それ以外の何か";
return temp;
}
ふらっと C#,C♯,C#(初心者用) Part141
■ このスレッドは過去ログ倉庫に格納されています
346デフォルトの名無しさん (ワッチョイ f1da-qnWR)
2019/01/19(土) 17:07:22.10ID:FJgPPckz0■ このスレッドは過去ログ倉庫に格納されています
