Parameters in Text file

0

I'm designing labels using Fingerprint, what I need is to modify text files with parameters, for example PP 18,060:PT "*%Value*" where value I should replace it with some string , the files will be saved by part number c:/Etiquetas/1234.txt

     String allString = "";
        if (File.Exists(part))
        {
            using (StreamReader sr = new StreamReader(part))
            {
                allString = sr.ReadToEnd();
            }
        }

At the moment of opening / reading the entire TXT, it only wanted to modify the field of "%*Value*" If you know of any library or any way to do this, I would appreciate it.

    
asked by CarlosR93 15.05.2018 в 22:26
source

1 answer

1
allString = allString.Replace("*%Value*", "nuevo valor");

.Net already includes the string.Replace(string oldValue, string newValue) function as previously mentioned

    
answered by 16.05.2018 в 00:31