2
Objective Cの他の文字列を参照してNSStringを変更したいのですが、誰かが助けてくれますか?NSStringのレプリカを作成する
例1:
a. "ab cd eg"
b. "ctghml"
I want to change string b like "ct gh ml" , in short want to insert space spaces exactly like string a.
Note: Number of letters will be same like (abcdeg).count = 6 and (ctghml).count = 6
例2:
a. (abcd) edt-tf
b. (lght)ert-tg
I want to change string b like "(lght) ert-tg" , in short want to insert space spaces exactly like string a.
Note: Number of letters will be same without spaces like ((abcd)edt-tf).count = 12 and ((lght)ert-tg).count = 12
ありがとう!
スペース文字だけがそれらの間で違いますか? – Tj3n
はい、スペースのみが違いです。 – Ren
空白を追加する場所を特定する方法。文字列のスペースを追加するかどうかを決定するロジックは、正規表現を作成するために使用します。 –