1
As I do to get only what is inside double quotes, the problem is the following, it is reading a file txt q on each line has a file path, as this below
"Dinosfuls Mods.bmd" 45454545s 454545
How do I pick up only that part without quotation marks?
Dinosfuls Mods.bmd**
file. Name = Dinosfuls Mods.bmd
file. Hash = 45454545s
file. Size = 454545
public static void AddFile(string File)
{
Globals.File file = new Globals.File();
string texto = File.Split(' ')[0];
int valorPos = texto.IndexOf(@"""") + 1;
string valorEntreAspas = texto.Substring(valorPos, texto.IndexOf(@"""", valorPos) - valorPos);
file.Name = valorEntreAspas;
//file.Hash = File.Split(' ')[1];
//file.Size = Convert.ToInt64(File.Split(' ')[2]);
//Globals.Files.Add(file);
}
And what’s your problem?
– Maniero
is only picking up before the file space le only "Dinofuls
– Rodrigo Pretti Fantin
It’s a little hard to understand. One of the reasons that is wrong is that the problem is not well defined, programming is detail, when one is missing or is wrong the code goes wrong. The code does several things that only you know because. We don’t have enough data entry information and exact output.
– Maniero
i need this code to take this line from txt "Dinosfuls Mods.bmd" 454545s 454545, read only what’s inside the quotes and play within a variable......
– Rodrigo Pretti Fantin
this line "Dinosfuls Mods.bmd" 454545454545 is in the text variable.
– Rodrigo Pretti Fantin
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site
– Maniero