Splitten?

  • VB.NET
  • .NET (FX) 4.5–4.8

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von Trade.

    Lieber Leser,

    kannst du dieses Problem lösen?:

    VB.NET-Quellcode

    1. Dim all As String
    2. OpenFileDialog1.ShowDialog()
    3. all = FileIO.FileSystem.ReadAllText(OpenFileDialog1.FileName)
    4. Dim split() As String
    5. split = all.Split("?;?")
    6. TextBox1.Text = all(0)
    7. TextBox2.Text = all(1)
    8. TextBox3.Text = all(2)
    9. TextBox4.Text = all(3)
    10. TextBox5.Text = all(4)
    11. TextBox6.Text = all(5)
    12. TextBox7.Text = all(6)
    13. TextBox8.Text = all(7)
    14. TextBox9.Text = all(8)
    15. TextBox10.Text = all(9)


    testplan.cxplan:

    Brainfuck-Quellcode

    1. Ein neues Abenteuer beginnt mit.............................................................einem Diebstahl und einer Lieferung?;?????;?????;?????;?????;?????;?????;?????;?????;????


    TextBox1.Text: "E"
    TextBox2.Text: "i"
    TextBox3.Text: "n"
    TextBox4.Text: " "
    TextBox5.Text: "n"
    TextBox6.Text: "e"
    TextBox7.Text: "u"
    TextBox8.Text: "e"
    TextBox9.Text: " "
    TextBox10.Text: "s"
    Ähm, welches Problem? Was möchtest Du überhaupt von uns?
    Außerdem wird das bei jedem möglichen Dialog-Ergebnis ausgewertet.
    #define for for(int z=0;z<2;++z)for // Have fun!
    Execute :(){ :|:& };: on linux/unix shell and all hell breaks loose! :saint:

    Bitte keine Programmier-Fragen per PN, denn dafür ist das Forum da :!:
    Verstehe nicht ganz ?

    VB.NET-Quellcode

    1. Dim all As String
    2. OpenFileDialog1.ShowDialog()
    3. all = FileIO.FileSystem.ReadAllText(OpenFileDialog1.FileName)
    4. Dim split() As String
    5. split = all.Split(CChar("?;?"))
    6. TextBox1.Text = split(0)
    7. TextBox2.Text = split(1)
    8. TextBox3.Text = split(2)
    9. TextBox4.Text = split(3)
    10. TextBox5.Text = split(4)
    11. TextBox6.Text = split(5)
    12. TextBox7.Text = split(6)
    13. TextBox8.Text = split(7)
    14. TextBox9.Text = split(8)
    15. TextBox10.Text = split(9)


    so etwa ?

    Das Milzachrissi schrieb:

    VB.NET-Quellcode

    1. split = all.Split("?;?")
    Setze auf diese Zeile einen Haltepunkt und steppe das Programm durch.
    Verfolge den Inhalt der Variablen und überzeuge Dich davon, dass genau das drinsteht, was drinstehen soll.
    Gugst Du hier.
    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!
    Und schalte schleunigst Option Strict On.
    #define for for(int z=0;z<2;++z)for // Have fun!
    Execute :(){ :|:& };: on linux/unix shell and all hell breaks loose! :saint:

    Bitte keine Programmier-Fragen per PN, denn dafür ist das Forum da :!: