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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:22:11+00:00 2026-05-17T00:22:11+00:00

new_str=@@2@@*##1 new_str1=@@3@@*##5##7 How to split the above string in python for val in new_str.split(@@*):

  • 0
       new_str="@@2@@*##1"
       new_str1="@@3@@*##5##7"

How to split the above string in python

          for val in new_str.split("@@*"):
            logging.debug("=======")
            logging.debug(val[2:]) // will give 
            for st in val.split("@@*"):
                //how to get the values after ##  in new_str and new_str1
  • 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-05-17T00:22:12+00:00Added an answer on May 17, 2026 at 12:22 am

    I don’t understand the question.

    Are you trying to split a string by a delimiter? Then use split:

    >>> a = "@@2@@*##1"
    >>> b = "@@3@@*##5##7"
    >>>
    >>> a.split("@@*")
    ['@@2', '##1']
    >>> b.split("@@*")
    ['@@3', '##5##7']
    

    Are you trying to strip extraneous characters from a string? Then use strip:

    >>> c = b.split("@@*")[1]
    >>> c
    '##5##7'
    >>> c.strip("#")
    '5##7'
    

    Are you trying to remove all the hashes (#) from a string? Then use replace:

    >>> c.replace("#","")
    '57'
    

    Are you trying to find all the characters after "##"? Then use rsplit with its optional argument to split only once:

    >>> a.rsplit("##",1)
    ['@@2@@*', '1']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here i give input string like this /org/bluez/1509/hci0 And i want output like this
In ruby % is used to format string. str % arg → new_str However
I have a string str[] where str[0]=My-Name; str[1]=is-drew; I want to get a new
I have written a sample KornShell function to split a String, put it in
how can I separate an array in smaller arrays? string[] str = new string[145]
import java.lang.*; import java.io.*; class test { public static void main(String[] a) throws Exception
I am having a string in CSV format. Please see my earlier question Parsing
I was looking through some code in a string escape library the other day
Using str.format() is the new standard for formatting strings in Python 2.6, and Python
I'm trying to run function which will return two strings by passing a pointer

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.