Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with dividing a string
#2
The problem lies within this line of your code:
[code2=vbnet]For i = 0 To intMaxNumber Step 4[/code2]

Since intMaxNumber is already the length of the String divided by 4, you are essentially dividing it by four again by stepping by 4 each time. To fix this, you just need to make sure that you are going through the whole string. You can do this by removing the intMaxNumber variable entirely and replacing the logic with something like this:
[code2=vbnet]For i = 0 To s.Length Step 4
strings.Add(s.Substring(i, 4))
Next[/code2]

That should do it!
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Problems with dividing a string - by brco900033 - 10-19-2013, 12:09 PM
Re: Problems with dividing a string - by brandonio21_phpbb3_import2 - 10-20-2013, 11:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search ListBox + Convert ListBox.item to string brco900033 3 13,888 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,286 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,759 02-28-2011, 07:39 AM
Last Post: brandonio21

Forum Jump:


Users browsing this thread: 1 Guest(s)