T
Terry Moreau
seems like a rather common and simple task for .NET, but I can't seem
to find any "elegant" way to do it without using MID or SUBSTRING and
code looping such as DO WHILE or FOR NEXT.
Here's a sample of what I'm looking for: break apart a string into
sections of 4 characters each...
DIM strMyInputString as String = "01234567ABCDEFGHIJ"
DIM strMyOutputString() as String = {some kind sectioning function or
method that operates on strMyInputString}
and here's the desired output string array:
(0) = 0123
(1) = 4567
(2) = ABCD
(3) = EFGH
(4) = IJ
String.Spilt wont' do it cause there's no delimiter
Regex has a Split that from what I can tell does nothing more
than .NET built in Split
Something in Regex that I'm missing maybe?
Select ? well maybe it could be used but I can't find a good VB.NET
example of how to use it !!!
Such a simple task, and there's no 'single function' or elegant 'one-
liner' that can chop an a string into regular sized sections???
What about converting the string to a Character Array then using Group
or Aggregate?
well i can't find good examples of these either so here I am posting
for ideas!
to find any "elegant" way to do it without using MID or SUBSTRING and
code looping such as DO WHILE or FOR NEXT.
Here's a sample of what I'm looking for: break apart a string into
sections of 4 characters each...
DIM strMyInputString as String = "01234567ABCDEFGHIJ"
DIM strMyOutputString() as String = {some kind sectioning function or
method that operates on strMyInputString}
and here's the desired output string array:
(0) = 0123
(1) = 4567
(2) = ABCD
(3) = EFGH
(4) = IJ
String.Spilt wont' do it cause there's no delimiter
Regex has a Split that from what I can tell does nothing more
than .NET built in Split
Something in Regex that I'm missing maybe?
Select ? well maybe it could be used but I can't find a good VB.NET
example of how to use it !!!
Such a simple task, and there's no 'single function' or elegant 'one-
liner' that can chop an a string into regular sized sections???
What about converting the string to a Character Array then using Group
or Aggregate?
well i can't find good examples of these either so here I am posting
for ideas!