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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:56:00+00:00 2026-06-18T02:56:00+00:00

Hi I have a string that comes from XML node, and I need to

  • 0

Hi I have a string that comes from XML node, and I need to split the string and get the “filename=” value in one string and all the block of based64 in other to be able to decoded it and create the file.

I’m using Split(“\n”) but is creating a line for each line and this is not I need.Any Idea?

<Attachment>
      --boundaryfIudow==
      Content-Type: application/octet-stream;   name="IERL4-12-61.pdf"
      Content-Disposition: attachment; name="IERL4-12-61.pdf";
      filename="IERL4-12-61.pdf"
      Content-Transfer-Encoding: base64

      JVBERi0xLjUNJeLjz9MNCjI4MzQgMCBvYmoNPDwvTGluZWFyaXplZCAxL0wgMTAxNTkyOS9PIDI4
      MzcvRSAxMDIyOTMvTiA0Mi9UIDEwMTUxMjkvSCBbIDU4MiA1MDZdPj4NZW5kb2JqDSAgICAgICAg
      DQoyODU1IDAgb2JqDTw8L0RlY29kZVBhcm1zPDwvQ29sdW1ucyA1L1ByZWRpY3RvciAxMj4+L0Zp
      bHRlci9GbGF0ZURlY29kZS9JRFs8QTlCNjc4ODAwODkwODg0QjgyQURCRDk5N0U4OERERTY+PERD
      RDYyNDA0OTNDQUUyNDE5MjkwNzc4OEMyMUE1MEEyPl0vSW5kZXhbMjgzNCA3MF0vSW5mbyAyODMz
      IDAgUi9MZW5ndGggMTEwL1ByZXYgMTAxNTEzMC9Sb290IDI4MzUgMCBSL1NpemUgMjkwNC9UeXBl
      L1hSZWYvV1sxIDMgMV0+PnN0cmVhbQ0KaN5iYmRgEGBgYmBgMQCRDLtBJKMZmNwCIll3gkhmQbAI
      WA3LOjAJES8Gs0+ASUkQyTQJzJYDy64AkYaNQJKR6xGIrSIDNucVmBQFkv9LWBiYGBm4F4FtZ2Ac
      LKTAy0Hhkv8M3xVeAQQYAET0ENYNCmVuZHN0cmVhbQ1lbmRvYmoNc3RhcnR4cmVmDQowDQolJUVP
      Rg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
      ICAgICAgICAgIA0KMjkwMyAwIG9iag08PC9DIDUzNS9GaWx0ZXIvRmxhdGVEZWNvZGUvSSA1NTcv
      TGVuZ3RoIDQxMC9PIDUxOS9TIDQzMz4+c3RyZWFtDQpo3mJgYGBiYGA2Z2BhYODLYRBkQABBBmYG
      VqA4xwcGBgETZ0MGBgUk2b1/mCIbzigELuC7wX2DxYbVfvNGh0NSr/TEfzImhL4R/iPyiZG1tfvQ
      LkU/h2iOoBKmByJ7WNNZ9RlzHCccSN6QeENrmoAnZ0CbGVOdY6HClA43HgU3wZtMx4Am79RUzt0e
      mxd2txRI7o7dAhRid/aWkmV3vBQly9soN0PWxaqjVOCVFU+JxAujni8S7UE9h1e0B/ItdngVOAMo
      oXjFeaVbIpQASaz2Zg/jW50FJNbIJl2/kLvg0XW+jdntYSAicquJzK0GxowG1owGBgbRBrYGwQYO
      Bihi7mBoYOoAMTsYJCBiHkAcgWCCcAMrUAlLB4MGmM8CUkq70AGCDAZu+UJwBDEwSINFXgHZqQyf
      D7g8YEkQU+C2YRViusc4vUGLIa1B+2HNHuUHbilAVaKrlzZIBkxmrPRg+BlyXyiIIYCBv+HAA4ih
      3GoMjF1lQAYjMDmoAukiBr4rRhAbpqXDo72fgb8qF6KK4TNAgAEAW6qi8w0KZW5kc3RyZWFtDWVu
      ZG9iag0yODM1IDAgb2JqDTw8L0xhbmcoZW4tVVMpL01hcmtJbmZvPDwvTWFya2VkIHRydWU+Pi9N
      ZXRhZGF0YSAxNDEgMCBSL09wZW5BY3Rpb24gMjgzNiAwIFIvT3V0bGluZXMgMjg4MCAwIFIvUGFn
      --boundaryfIudow==--
    </Attachment>
  • 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-18T02:56:01+00:00Added an answer on June 18, 2026 at 2:56 am

    Here you go (src is your source string):

    var split = src.Split('\n').Select(p => p.Trim()).ToList();
    
    var filename = split.First(p => p.StartsWith("filename="));
    filename = filename.Substring(10, filename.Length - 11);
    
    var base64 = split[split.Count - 2];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string that i need to split where there are 2 or
I have a string coming from an XML file that appears to have been
I have a XML string comming from a Rest WS that I created on
I'm using .NET 3.5 and I have a date that comes in as string
I have string that look like Array that fetched from other webservice like this
I have a String that holds the string representation of a byte value. String
Here is the problem: I have one giant string of xml data stored in
I have a xml like that: <item> <name>chuck - norris</name> </item> I can get
I have a gridview that gets its data from a webservice. This comes into
I'm developing an application that needs to get data from an XML file. Some

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.