I am trying to split the letters in a textbox in to letters and add it to a listbox. And then convert each letter separately to unicode and add "| " at the end of each letter. For example;
Lets say we have a
• listbox called "lst1" put separated letters into this
• Textbox called "tx1" put the input string here
• A Second Textox called "tx2" final output locatin

This is the code i am currently trying to use

Dim s As String = tx1.Text
        Dim arrayLetters As Array = Split(s)
        Dim i As Integer
        For i = 0 To UBound(arrayLetters)
           lst1.Items.Add(arrayLetters(i))
        Next

I am not able to figure out the rest of the code. Please help me

hope i understood your question correctly

Private Sub ShortWay()
		Dim st As String = "myString"
		Dim result As String = String2Unicode(st).Replace(Chr(0), Chr(0) & "|")
		Console.WriteLine(result)
	End Sub

	Private Sub LongWay()
		Dim st As String = "myString"
		Dim sb As New Text.StringBuilder
		For Each c As Char In st
			sb.AppendFormat("{0}|", String2Unicode(c))
		Next
		Console.WriteLine(sb.ToString)
	End Sub

	Private Function String2Unicode(ByVal s As String) As String
		Dim sSearchUnicode As Byte() = System.Text.Encoding.Unicode.GetBytes(s)
		Return System.Text.Encoding.Default.GetString(sSearchUnicode)
	End Function
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.