Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with dividing a string
#5
I'm not sure if I'm using the code the right way but I get the same error, again on the same line:
[code2=vbnet]strings.Add(s.Substring(i, 4))[/code2]

The code that I have now is the following:
[code2=vbnet]Dim strings As New List(Of String)
'Just an example of the key, this string will be generated randomly
Dim s As String = "p6s0arJHmuOQmUhIczfnynRS1dOrRxYm0EF05b5Vk1YR7TQVItShNjFJQ1L3d"
Dim i As Integer = 0
Dim remainder As Integer = s.Length Mod 4
For i = 0 To (s.Length - remainder) Step 4
strings.Add(s.Substring(i, 4))
Next
strings.Add(s.Substring(s.Length - remainder, remainder))
For Each srtininglist As String In strings
MessageBox.Show(srtininglist)
Next[/code2]

Am I doing something wrong because I still get the same error?

PS: What's the html code for the 'vbnet code' block? I still use the old one [code][//code].


Messages In This Thread
Problems with dividing a string - by brco900033 - 10-19-2013, 12:09 PM
Re: Problems with dividing a string - by brco900033 - 10-25-2013, 11:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search ListBox + Convert ListBox.item to string brco900033 3 13,889 09-13-2012, 03:03 PM
Last Post: brandonio21
  How to write string query on multiple lines kismetgerald 1 8,541 08-29-2012, 04:01 PM
Last Post: brandonio21
  VB.Net Query Builder Problems. Moldraxian 2 11,291 08-17-2012, 05:33 AM
Last Post: Moldraxian
  Outputting a string with quotation marks in it. openeXpressions 15 45,089 12-20-2011, 09:24 PM
Last Post: openeXpressions
  Problems with multiple textboxes and coding LearningVB2010 30 87,763 02-28-2011, 07:39 AM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)