string x = "I am a hunter, what do i do. <Name> is a good boy. His age is <Age> and a <occupation> of <Institute>. \n\n He is passionate about his <passion> and also a hardworking fellow. <WifeName> is his wife and she is a sweet girl, She loves her husband a lot. Her age is <WifeAge> and <occupation> of <Institute>";
このテキストは何の意味もありません。しかし、私がしなければならないのは、すべての「<
」を「」に、すべて<b>
の「>
」を「</b>
」に、すべての「\n\n
」を「 」に置き換えること<br/>
です。
私は使用しようとしました:
string y = replace(replace(x,"<","<b>"),">","</b>");
これは私を壊滅的な結果に導きました。何が起こったのか、皆さんは推測できると思います。今、私はこの交換のための簡単でシンプルな解決策を探しています。これを明確にできたらいいのにと思います。