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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:57:51+00:00 2026-05-28T01:57:51+00:00

I have a string with carriage returns in it I separate them using the

  • 0

I have a string with carriage returns in it I separate them using the following split:

 string[] RemoveEmptySpace = result.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

so it becomes like this:

Server:  xxx
Address:  xxx.xxx.11.10

Non-authoritative answer:
Name:    test.com
Address:  xxx.xxx.888.555

now my question is how do i get the first instance of Address numbers only not the text e.g.’xxx.xxx.11.10′? the string comes from nslookup so it is dynamic the position may change…

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-05-28T01:57:52+00:00Added an answer on May 28, 2026 at 1:57 am

    You could iterate over the collection of strings you got from the split, and parse those beginning with “Address”. i.e. something like this:

    string[] RemoveEmptySpace = ...;
    
    // ...
    foreach (string line in RemoveEmptySpace)
    {
        if (line.StartsWith("Address:"))
        {
            string[] segments = line.Split(new char[1] { ':' }, StringSplitOptions.RemoveEmptyEntries);
    
            // Use the second segment, as this should be the value
            string value = segments[1].Trim();
    
            // Note: You now have the string representation of the Address numbers.
    
            // Stop searching for more addresses
            break;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a string that has multiple carriage returns in it, i.e:
I have string like \LESSING\root\cimv2:Win32_UserAccount.Domain=LESSING,Name=Admin How to convert it to LESSING\Admin using Framework?
I have string looking like this: 'Toy Story..(II) (1995)' I want to split the
I have a JScrollPane that holds a JLabel using the following code: //Create TEXT
I have to text file in the following format : Word [tab][tab] Word [Carriage
I have the following string in Oracle as one continuous line, where instead of
I have the following string: blah blah yo<desc>some text with description - unwanted text</desc>um
I have the following code: string myTest = Line1Test + Environment.NewLine + Line2Test +
So I have the following string of data, which is being received through a
When inserting a new line character into a string I have usually done this:

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.