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 8863261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:55:58+00:00 2026-06-14T15:55:58+00:00

I have strings of the form: something~#~something. Essentially I am using ~#~ as a

  • 0

I have strings of the form:
something~#~something.

Essentially I am using ~#~ as a delimiter, but I would like to only split the first element from the rest of the elements.

For instance, if I had the following string:
What~#~AGreat~#~Day

I would like my first match to be “What”
and my second match to be “AGreat~#~Day.

The actual strings I’m working with look like this:
A1~#~@NP->_A1
So they’re not limited to alphanumeric characters. Can anyone help? I tried looking around for a similar problem but I can’t seem to get it working.

Thanks!

  • 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-14T15:56:00+00:00Added an answer on June 14, 2026 at 3:56 pm
    String first = input.substring(0, input.indexOf("~#~"));
    String second = input.substring(input.indexOf("~#~") + 3, input.length());
    

    Output:

    first:  What
    second: AGreat~#~Day
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of strings of the form: @source = ( something,something2,third ,something,something3
I seem to have a problem passing some strings on from one form to
I have strings of the form: greengrocerabc sandwichcba oscardcba I'd like to lazily match
I'm trying to capture key-value pairs from strings that have the following form: a0=d235
I have strings of following form a = x + y or abc =
I have a bunch of strings of the form: AAA.BBB[0].CCC.DDD[5].EEE = 123. Some contain
I have a string of the form foo-bar-1.23-4, and I need to split at
I have an html form and within the form I have a <button> element.
I have some inputs that I need to process from a form. The #
Essentially, I have a Do..While loop going through some lines from a text file.

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.