문서의 값을 업데이트하는 응용 프로그램이 있지만 이러한 문서 중 일부에는이 값의 항목이 여러 개 있습니다. 이로 인해 Do Something 루프를 만들었지 만 이것은 단지 루프이며 값을 대체하지 않습니다.
내 코드는 다음과 같습니다.
do
{
int dollarIndex = script.IndexOf("$");
string nextTenChars = script.Substring(dollarIndex - 17, 17);
string promptValue = CreateInput.ShowDialog(nextTenChars, "Input");
script.Replace("$", promptValue);
}
while (script.Contains("$"));
문자열은 변경할 수 없으므로 다음을 수행해야합니다.
script = script.Replace("$", promptValue);
간단하게
script.Replace("$", promptValue);
값을 업데이트하지 않습니다. script
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다