Skip to content

Commit 3d111db

Browse files
Merge pull request #3 from sorvon/master
修复了输入相同通配符导致的bug
2 parents 28db3ce + 519f703 commit 3d111db

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Register1024/MainForm.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,17 @@ List<String> increment(String code, String target, List<String> jw, List<Char> l
209209
String tmp2 = code;
210210
for(int i =0; i<jw.Count; i++) {
211211
if(jw[i].Equals("{c}")) {
212-
tmp2 = tmp2.Replace("{c}", last[i].ToString());
212+
Regex reg = new Regex("{c}");
213+
tmp2 = reg.Replace(tmp2, last[i].ToString(), 1);
213214
}
214215
if(jw[i].Equals("{a}")) {
215-
tmp2 = tmp2.Replace("{a}", last[i].ToString());
216-
}
216+
Regex reg = new Regex("{a}");
217+
tmp2 = reg.Replace(tmp2, last[i].ToString(), 1);
218+
}
217219
if(jw[i].Equals("{i}")) {
218-
tmp2 = tmp2.Replace("{i}", last[i].ToString());
219-
}
220+
Regex reg = new Regex("{i}");
221+
tmp2 = reg.Replace(tmp2, last[i].ToString(), 1);
222+
}
220223
}
221224
res.Add(tmp2);
222225

0 commit comments

Comments
 (0)