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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:45:42+00:00 2026-06-13T13:45:42+00:00

For examples, I have: String s = {\ABC\}:Mycontent{\123\}; I only want to get the

  • 0

For examples, I have:

String s = "{\"ABC\"}:Mycontent{\"123\"}";

I only want to get the Mycontent{“123”} part and this part can be changed dynamically. Can anybody please show me how to do it (Fast performance)?

  • 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-13T13:45:44+00:00Added an answer on June 13, 2026 at 1:45 pm

    Split method inside string can split a string around matches of regular expression so you can use this method.
    You can also use subsequence method if the position of the string you want is always the same.
    Also you can use the substring method.
    Many ways. Personal favorite is substring

    str2=str.substring(begin, [end]) 
    

    I put [] around end because it is not necessary. If you do not put an end index the substring will continue until the end of the string. Both indexes must be integers. Also this method returns a string.

    If the size of the number changes dynamically aswell (e.g. 123 turns to 4567) you can solve this by not using an end index then using a find function and finding the character that comes after the last digit in your string (I suppose this does not change) and then replacing that character (using a replace method) with a \0 so the string ends there.

    All the methods I have mentioned and there explanations can be found in javadoc

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

Sidebar

Related Questions

I have this string 123abc123 how can i get only integers from this string?
I have a string like: This is my abc.def ght.123 example 12.34 test I'd
I have this egrep search: egrep -is (ABC-[0-9]+) which matches ABC-123 anywhere in a
I have for example string s = abc edef; I create istringstream with this
For example I have a string <abc=xyz> abc can change and so does the
I have a string like: abc-12\nxyz-17\nabc-18\npqr-13\n I want to match the number after each
I have an string like this: string s1 = abc,tom,--Abc, tyu,--ghh; This string is
If I have a string Abc: Lorem ipsum sit amet , how can I
I have a string that contains something like this: ##### abc 'foo' /path/to/filename:1 #####
If I have a string that contains a url (for examples sake, we'll call

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.