Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 125185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:07:08+00:00 2026-05-11T05:07:08+00:00

Background: I needed to split a string of numerous words into an array which

  • 0

Background:

I needed to split a string of numerous words into an array which separates the words for me for further use later on in my code. However, I needed to get rid of any numbers which might be present in the string so I declared a string contaning characters which I wanted to use as separators/delimiters as follows:

dim Separators As String = ' 1234567890' 

so my code became more or less as follows:

''//USING SPLIT-FUNCTION dim MyTestString as String = 'This is 9 a 567 test'  dim Separators As String = ' 1234567890' dim ResultWithNoNumbers() as String  ResultWithNoNumbers = Split(MyTestString,Separators.ToCharArray) Messagebox.Show(ResultWithNoNumbers.Length.ToString) ''//Result is 1 and no split was performed 

This did not work since the Split-functions did not consider my Separators as individual characters

however this worked..

''//USING SPLIT-METHOD dim MyTestString as String = 'This is 9 a 567 test'  dim Separators As String = ' 1234567890' dim ResultWithNoNumbers() as String  ResultWithNoNumbers = MyTestString.Split(Separators.ToCharArray,                                     _StringSplitOptions.RemoveEmptyEntries) Messagebox.Show(ResultWithNoNumbers.Length.ToString) ''//Result is 4 and split was performed 

So far, so good – since one has more options with the Split-method compared to the Split-function, I managed to resolve my problem.

Now to my question, let’s say I only needed the standard space-character (‘ ‘) as a delimiter (and no need to get rid of numbers like in above example), then both ways would work. So which one would you use? Apart from various options available, are there any advantages using a particular one? Perhaps one is faster, less memory-hungry?

EDIT: I’m developing for Windows Mobile and that’s why speed- and memory-issues get important.

Thank you.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:07:08+00:00Added an answer on May 11, 2026 at 5:07 am

    I would use regular expressions

    Dim MyTestString As String = 'This is 9 a 567 test 23424234 this is  23 another test 23 and 3 again and one 34234 more' Dim reg_exp As New Text.RegularExpressions.Regex('\d') Dim reg_exp2 As New Text.RegularExpressions.Regex('\s{2,}')  MyTestString = reg_exp.Replace(MyTestString, String.Empty) MyTestString = reg_exp2.Replace(MyTestString, ' ')  Dim strArr() As String strArr = MyTestString.ToString.Split(' ')  Console.WriteLine(MyTestString) Console.ReadLine() 

    OUTPUT:

    This is a test this is another test and again and one more

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 228k
  • Answers 228k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This should work: Sub main() Dim maxRow As Integer Dim… May 13, 2026 at 1:36 am
  • Editorial Team
    Editorial Team added an answer The (uint) (object) myEnum approach fails because, by default, C#… May 13, 2026 at 1:36 am
  • Editorial Team
    Editorial Team added an answer The String Build.VERSION.RELEASE will give you the user-visible version string… May 13, 2026 at 1:36 am

Related Questions

Question: Does Informix have a construct equivalent to Oracle's materialized view or is there
I publish technical books, in print, PDF, and Kindle/MOBI, with EPUB on the way.
Going through the documentation of the SDF, i found many classes like the BitmapEx
I have a Java background so I’m used to having Maven handle all problem

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.