Note that there are some explanatory texts on larger screens.

plurals
  1. POSplit(String) Navigation - "Go to next substring"
    text
    copied!<p>I'm by no means an experienced programmer. This task I have is very likely a one-off, so don't feel bad for giving me answers instead of pointing me in the right direction :P</p> <p>I've searched as long as I can bear, and just can't find what I'm after.</p> <p>I just need to be able to move to the next substring of a string. In this instance, "go to next substring" equates to "go to next line". I just need to be told that one command and I'll be on my way, but I can't find any trace of it. </p> <p>Here's a snippet of code with the magic command installed:</p> <pre><code>Dim count As Integer Dim line As String Dim lines As String() = My.Computer.FileSystem.ReadAllText("C:\test.txt").Split(New Char() {vbCrLf}) For Each line In Lines If line.Contains("#") count = 0 **GO TO NEXT LINE** Do Until line.Contains("#") count = count + 1 **GO TO NEXT LINE** Loop Console.WriteLine(line &amp; ", " &amp; count) End If Next </code></pre> <p>Unless I'm missing something, I should be able to use text formatted like this:</p> <pre><code>#VERSE1 Lyrics lyrics Lyrics lyrics #CHORUS1 Lyrics lyrics Lyrics lyrics Lyrics lyrics Lyrics lyrics #VERSE2 Lyrics lyrics Lyrics lyrics Lyrics lyrics #CHORUS2 Lyrics lyrics Lyrics lyrics Lyrics lyrics Lyrics lyrics Lyrics lyrics #END </code></pre> <p>And receive the result:</p> <pre><code>#VERSE1, 2 #CHORUS1, 4 #VERSE2, 3 #CHORUS2, 5 #END, 0 </code></pre> <p>I apologize if I am wildly off the mark. I'm just putting together bits and pieces I've found from various tutorials.</p> <p>I've managed to get all the other functions I need working with Googling alone, but this last task has me stuck.</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload