0
I want to get a List(Of String)
of text blocks, but there is a problem:
{ --isso é um bloco;
echo "Aqui tem um } no meio";}
and would like to get that way:
--isso é um bloco;
echo "Aqui tem um } no meio";
but you’re coming back to my method:
--isso é um bloco;
echo "Aqui tem um
and just there, there’s some way then to get several blocks except when they are inside the characters "..."
?
Here’s my method code:
Dim tmpBlocks() As String = theFile.Split({"{"}, StringSplitOptions.RemoveEmptyEntries)
Dim Blocks As New List(Of String)
For i As Integer = 0 To tmpBlocks.Length - 1
Blocks.Add(tmpBlocks(i).Split(New [String]() {"}"},
StringSplitOptions.RemoveEmptyEntries)(0))
Next
' Blocks é a variável de cara bloco
OBS: I accept answers in C#, VB and Regular Expressions (Regex).
You can post your method?
– stderr
What is the expected response to the input
{ "\"}" }
? Or to the entrance{ """}" }
? You’re doing this to parse JSON or some programming language?– user25930
My own language @ctgPi
– CypherPotato
@qmechanik ready.
– CypherPotato
Is not this what you want to do?
– stderr
If I understand it right, not exactly - consider the entrance
{ echo "{"; }
.– user25930
@qmechanik not exactly, a new bug appears but with the
{
. https://dotnetfiddle.net/DwGiAk– CypherPotato