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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:00:02+00:00 2026-06-09T02:00:02+00:00

I had this string=dontcare noone &11111-&1111-&C00 noone and I had to extract the substring

  • 0

I had this
string=”dontcare noone &11111-&1111-&C00 noone”

and I had to extract the substring &11111-&1111-&C00
from the first & to the first blank

I’ve tried some index and some sed without any luck.

Someone has some great advice?

  • 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-09T02:00:04+00:00Added an answer on June 9, 2026 at 2:00 am

    You can use bash’s string manipulation capabilities:

    string="dontcare noone &11111-&1111-&C00 noone"
    
    # remove everything up to the first "&"
    string="&${string#*&}"
    
    # remove everything from the end to the earliest blank
    string="${string%% *}"
    
    # ta da!
    echo $string
    &11111-&1111-&C00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given below is program for encrypting a string. I had taken this code from
So for instance if I had this string : color=green&animal=panda Is it possible that
I had this code building and running perfectly: boost::function<void(string)> bar = boost::bind(&Bar::BarHandler, this, _1);
I had a Scala class as follows: class ClassA(val name: String) { println(this is
For this assignment I had to create my own string class. I initially wrote
Had this: rtable.insert ( pair<string,string>(destination,nhop) ); // route insertion return 0; Changed it to
I had this idea and my first reaction after having it was That's a
I had this code: String[] lineElements; . . . try { using (StreamReader sr
I had this code trace in my Razor view @{ string markerPlacementScript = alert('Hello');
i have this string: http://localhost/migo2/photo.php?id=68&a_id=83&p_id=349&type=1#p_id=302 and i would like to get the value of

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.