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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:48:47+00:00 2026-06-03T19:48:47+00:00

when i try to get the text from a document, if it is followed

  • 0

when i try to get the text from a document, if it is followed by some special characters such as TM or C (for copyright) and so on, after writing it into a text file it will makes some unexpected added to it. as an example, we can consider the following:

if we have Apache™ Hadoop™! and then if we try to write in into a text using FileOutputStream then result would be like Apacheâ Hadoopâ which the â is nonsense for me and generally i want a way to detect such characters in the text and just skipping them for writing them, is there solution to this?

  • 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-03T19:48:48+00:00Added an answer on June 3, 2026 at 7:48 pm

    If you want just the printable ASCII range, then iterate over your string character by character building a new string. Include the character only if it’s within the range 0x20 to 0x7E.

    final StringBuilder buff = new StringBuilder();
    for (char c : string.toCharArray())
    {
      if (c >= 0x20 && c <= 0x7E)
      {
        buff.append(c);
      }
    }
    
    final FileWriter w = new FileWriter(...);
    w.write(buff.toString());
    w.close();
    

    If you want to keep carriage returns and newlines, you also need to consider 0x0A and 0x0D.

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

Sidebar

Related Questions

I try to get some insights from the pages I am administrator on Facebook.
If I try to load an HTML document into PHP DOM I get an
Hello I know how to open and get plain text from a word file
I scan from a text document the following values into various arrays: 0001:Satriani:Joe:6:38.0 0002:Vai:Steve:1:44.5
Hello there im trying to save some data from dynamic textboxes into XML file.
Using following code I try to get updated list of checkbuttons' corresponding text values,
I try to get to a page straight from Bash at http://www.ocwconsortium.org/ . The
I try to get the last modification date of a file: NSFileManager *fm =
i try to get the value from a radio box in a input box
How do i get this text from the following html code using Jsoup? <h2

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.