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

  • SEARCH
  • Home
  • 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 8898397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:36:22+00:00 2026-06-15T00:36:22+00:00

I know I can split a string into multiple substrings by giving a delimiter.

  • 0

I know I can split a string into multiple substrings by giving a delimiter. I know I can also choose a substring based on character position like this:

sAddressOverflow = Right(sAddressLine1,5)

What I would like to do though is split an input string like this:

“123 South Main Street Apt. 24B”

But I only want to end up with two substrings which are split based on the first space to the left of the 25th character. So my desired output using the above input would be:

Substring1 = “123 South Main Street”
Substring2 = “Apt. 24B”

Is this possible?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-06-15T00:36:23+00:00Added an answer on June 15, 2026 at 12:36 am

    Regular expressions have the advantage that you can configure your pattern independently from the location where you use it and that they are highly adaptable, so I prefer to do string manipulation with regular expressions. Unfortunately the pattern of Ansgar Wiechers does not exactly match your requirement. Here is one that does:

    myString = "1234 6789A 234567 9B12 4567 890"
    Set re = new RegExp
    re.Pattern = "^(.{1,25}) (.*)$"
    Set matches = re.Execute(myString)
    
    wscript.echo "leftpart: " & matches(0).submatches(0)
    wscript.echo "rightpart: " & matches(0).submatches(1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know how i can split a string in php based on
I would like to split a line into words. I know this can be
How can i split the following string into Key-Value Pair / Hash table ...
I want to split the qc column every 255 characters into multiple strings and
We are currently writing an application which is split into multiple projects/modules. For example,
I'm trying to split a string into sentences (delimited by sentence delimiters). The code
How can i split data from string? I have my string like this, Url=http://www.yahoo.com
I would like to split string into List on two possible delimeters / or
I have to split a string into several ones. In fact what i need
I'm trying to split a string into an array. I've tried str_split() but the

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.