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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:57:10+00:00 2026-05-24T17:57:10+00:00

I currently have the following code to get a specific value i need from

  • 0

I currently have the following code to get a specific value i need from a string.

char[] delimiterChars = { ' ', 'B', 'O', 'B'};
                  string text = input.ToString();
                  string[] words = text.Split(delimiterChars);

Unfortunately before the space in the string is unknown characters that are entered in by the user. Is there a wild card that gets all the characters before that space? I was hoping that i could just put a * inside of the first quotation with the space '* ' but it doesn’t seem to like that.

Thanks.

EDIT:

So the string variable is made up of a series of characters inputted by the user then it has BOB and a random integer added to the end. My goal is to retrieve just the number at the end of the string.

An example of a sample string would be “user BOB44”
Sorry for the confusion and thanks again!

  • 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-24T17:57:11+00:00Added an answer on May 24, 2026 at 5:57 pm

    You can use a regular expression to get the number at the end of a string

    /([0-9]*)$/ will capture the last group of sequential numeric characters at the end of a string

    In C# (it looks like you’re using that language):

    Regex pattern = new Regex("([0-9]*)$");
    MatchCollection matches = pattern.Matches(input);
    if (matches.Count > 0) {
        // matches[0] will contain the number
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

currently I have following code: home.php <form name='myformname' id='myformid'> <input type='text' name='mytext1' value='abc'> <input
currently I have the following code: String select = qry.substring(select .length(),qry2.indexOf( from )); String[]
currently i have jdbc code with the following basic stucture: get Connection (do the
I currently have the following code: public MyObject SessionStore { get { if (Session[MyData]
I have a select query that currently produces the following results: Description Code Price
I have the following code: #include <iostream> #include <string> #include <unistd.h> using namespace std;
I have the following problem using subversion: I'm currently working on the trunk of
For some reason, I have to move a lot of C# code from Visual
Inside a class of mine I have the following code: mHandler = createHandler(); private
I have the following before_filter : def find_current_membership respond_to do |wants| wants.html { @current_membership

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.