Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の形式の文字列があります。
ABCDEFGHIJKLMN-OOOOOO
文字列値をc#で次のように切り捨てるにはどうすればよいですか?
ABCDKLMNOOOOOO
アドバイスをお願いします
わかりました。論理ルールを推測します。どうですか:
string newStr = str.Substring(0,4)+str.Substring(10,4)+str.Substring(15,6);
または多分あなたがしたい
string newStr = str.Substring(0,4)+str.Substring(10,4)+str.Split("-")[1];
あなたが望むことができる多くのものがあります