• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1653
  • Last Modified:

array function on string by character count

this one should be easy i cannot find the code to take care of it though
i have the following string

045718691031

The character count will always be (12) i need the command that will allow me to replace the (9) character with "" nothing

04571869031

i need the code to array a string by character?
thanks in advance

 
0
DTRON04
Asked:
DTRON04
1 Solution
 
Andrea ErcolinoCommented:
add left$ up to 8th char to right$ from 10th char
0
 
DTRON04Author Commented:
thanks for helping me through that brain fart RAP

here is the code for RAP's sugestion

Dim strContents as String
strContents = 045718691031
strContents = CStr(Microsoft.VisualBasic.Left((strContents), 8) + CStr(Microsoft.VisualBasic.Right(strContents, 3)))

Thanks!

 
0
 
iboutchkineCommented:
Dim s As String = "045718691031"

        ' A string can be accessed as an array of characters
        Dim i As Integer
        For i = 0 To s.Length - 1
           if i = 8 then
             Console.Write("")
           else
            Console.Write(s.Chars(i))
           end if
        Next


from here you can do whatever you want. Right to another array, replace etc
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now