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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:57:09+00:00 2026-05-25T05:57:09+00:00

this the what the data in the string looks like: <temp><id>TGPU1</id><label>GPU</label><value>67</value></temp><temp><id>THDD1</id><label>ST3320620AS</label><value>34</value></temp><temp><id>FCPU</id><label>CPU</label><value>1430</value></temp> (there is more,

  • 0

this the what the data in the string looks like:

<temp><id>TGPU1</id><label>GPU</label><value>67</value></temp><temp><id>THDD1</id><label>ST3320620AS</label><value>34</value></temp><temp><id>FCPU</id><label>CPU</label><value>1430</value></temp>

(there is more, that is just a small snipping of the original output.)
what i would like to do is feed it through some fast code(not in terms of how long the actual code is, but how long it takes to execute) that will remove all the

<temp><id>TGPU1</id><label>GPU</label><value>

and output it to a new string with only the value between all the <value>‘s and </value>‘s. im looking for output in the string like: 67341430.
i found this code:

bool FoundMatch = false;

try {
    Regex regex = new Regex(@"<([be])pt[^>]+>.+?</\1pt>");
    while(regex.IsMatch(yourstring) ) {
            yourstring = regex.Replace(yourstring, "");
    }
} catch (ArgumentException ex) {
    // Syntax error in the regular expression
}

but it only removes the <*pt> which cold be changed to remove something else. but it would only remove one tag at a time. not very fast if i have to remove all tags.

thanks

PS if you wanted to know, the code below is the code i am looking to add this to. this is also the code that printed the original string mentioned above:

static void Main(string[] args)
{
    Console.WriteLine("Memory mapped file reader started");

    using (var file = MemoryMappedFile.OpenExisting("sensor"))
    {
        using (var reader = file.CreateViewAccessor(0, 3800))
        {
            var encoding = Encoding.ASCII;
            Console.WriteLine(encoding.GetString(bytes));
        }
    }

    Console.WriteLine("Press any key to exit ...");
    Console.ReadLine();
}
  • 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-25T05:57:10+00:00Added an answer on May 25, 2026 at 5:57 am

    You can use LINQ:

    String.Concat(
        XElement.Parse(...)
                .Descendants("value")
                .Select(v => v.Value)
    );
    

    If you’re really concerned about performance, you could use XmlReader directly to read through <value> tags and append to a StringBuilder.
    However, that’s not worth it, unless your XML is hundreds of megabytes large.

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

Sidebar

Related Questions

my string looks like this: abcd efgh [data\] pqrl 12fgd] I want to parse
I have a string like this: TEST.DATA.Data.COR.Point,2;TEST.DATA.Data.COR.Point,5;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.Point,12;TEST.DATA.Data.COR.WordTOFIND,18 I have a list of array with
I have a data structure that represents C# code like this: class Namespace: string
How I can do something like this in C++: void my_print(format_string) { vector<string> data;
The connection string generated by entity framework looks like this. <add name=ETestEntities connectionString=metadata=res://*/Models.TestModel.csdl|res://*/Models.TestModel.ssdl|res://*/Models.TestModel.msl;provider=System.Data.SqlClient;provider connection
I've got a group of data that looks like this: 001 001 One 001
I have a data input that looks like this: seq 75 T G -
I got this code to find text in a string that looks like links
I have some JSON data that looks like this: { data: [{ name:John Smith,
I have a dataframe that looks like this: data median min max no_of_threads 2.33

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.