这是我想要实现的目标:我想替换
void some_function(int, int *, float);
和
void some_function(int a, int *b, float c);
到目前为止,当我遍历字符串时,我已经尝试用 chr(97+i) 替换“,”。
text = len("void some_function(int, int *, float);")
i = 0
for j in range(0, length)
if text[j] == ",":
rep = " " + chr(97+i) + " .,"
text = text.replace("," rep)
i = i + 1
j = 0 # resetting the index, but this time I want to find the next occurrence of "," which I am not sure
但这并没有起到作用。请让我知道是否有更好的方法来做到这一点。