[Help] Take Right Text in vb.net

Actually
It's on a TreeView
nodr = TreeView1.Nodes.Find(nodx.Name, True)(22).Nodes.Add("http://forum.ragezone.com/f71/forum-rules-101410/", "[02-11-2012] RaGEZONE Forum Rules")

I want to copy the TreeView1.SelectedNodes.Text to another Textbox1 while i click the node, but i don't want to display [02-11-2012] on the Textbox

What should i do?
 
Code:
            string input = "[02-11-2012] RaGEZONE Forum Rules";
            Console.WriteLine(input.Substring(input.IndexOf(']') + 2)); // Outputs "RaGEZONE Forum Rules"

You could try to create a custom string format, but i guess the above method should work.
 
Code:
            string input = "[02-11-2012] RaGEZONE Forum Rules";
            Console.WriteLine(input.Substring(input.IndexOf(']') + 2)); // Outputs "RaGEZONE Forum Rules"

You could try to create a custom string format, but i guess the above method should work.

Think the solution is not for VB.net

I got this error message:
Error 2 'String' is a class type and cannot be used as an expression.
Error 3 '.' expected. On Input
Error 4 Overload resolution failed because no accessible 'Input' accepts this number of arguments. On Input also
Error 5 Overload resolution failed because no accessible 'Input' accepts this number of arguments.
Error 6 Character is not valid. On ']'

I also try different method also not working
Dim input As String = "treeview1.selectednodes.text"
Console.WriteLine(input.Substring(input.IndexOf("]"C) + 2))
' Outputs "RaGEZONE Forum Rules"
 
The idea is to find the index where ']' occurs and take the substraing starting from the position 2 more than this index. I dont do VB, my solution was in C#

2
 
Think the solution is not for VB.net

I got this error message:
Error2'String' is a class type and cannot be used as an expression.
Error3'.' expected. On Input
Error4Overload resolution failed because no accessible 'Input' accepts this number of arguments. On Input also
Error5Overload resolution failed because no accessible 'Input' accepts this number of arguments.
Error6Character is not valid. On ']'

I also try different method also not working
Dim input As String = "treeview1.selectednodes.text"
Console.WriteLine(input.Substring(input.IndexOf("]"C) + 2))
' Outputs "RaGEZONE Forum Rules"

By the way, it should look something like:
Code:
foreach(var node in treeView1.SelectedNode)
{
    Console.WriteLine(node.Substring(node.IndexOf(']') + 2));
}

Instead of
Code:
Dim input As String = "treeview1.selectednodes.text"
Console.WriteLine(input.Substring(input.IndexOf("]"C) + 2))
2
 
Yes, but you get the idea dont you? You iterate through every node and print the text instead of doing "TreeView1.SelectedNodes.Text"

Because what you did your just assigning a string variable with the value "TreeView1.SelectedNodes.Text". Its like string s = "apple", you are not doing anything special.

You have to iterate through treeView1.selectedNodes and foreach node inside you print it's text. You dont go string s = "treeView1.SelectedNodes.Text" because firstly, you're not doing anything special, just assigning a string literal to a string variable and secondly, the the object treeView1.SelectedNodes does NOT have the property named "Text".

And please man, C languages arent hard to understand are they? If you are insisting for a non C# answer, then just take my code as pseudocode.

2
 
Back