Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

(Mac User) How can I remove unwanted control characters from my codes that are pasted into GDB from Microsoft word?

+9 votes
asked Nov 28, 2021 by Nicole (210 points)
Hello, I am a mac user and my assignment needs me to clear out unwanted control characters, I can't download any notepad or whatever, so I'm wondering how do I solve this issue?

1 Answer

0 votes
answered Nov 28, 2021 by Peter Minarik (86,580 points)
edited Nov 29, 2021 by Peter Minarik

I'm not sure what you're after.

  1. Do you have a piece of text (source code, or whatever) where you want to remove control characters?
    • Find and replace is your friend! Search for the control character and replace it with nothing (effectively deleting it).
    • I'm not sure what control characters you mean. You can get rid of all the extra glitter and shine that include formatting and what not by (not using MS Word at all) first copying your content into a plain text editor, such as Notepad, VIM and then copy the text from this plain text editor into the GDB source code section. The plain text editor must have sanitised the data not to contain any formatting or special characters just really the text you need.
  2. Do you want to write a program that receives some text on the standard input / or file and outputs the text without special control characters to the standard output or another file? The special control characters need to be specified too.
    • The implementation is not too difficult based on the above suggestion. Give it your best try and submit your code for review. I'm more than happy to look at it and fix any problems. (However asking for complete solutions for homework is frowned upon, hence my suggestion to try to implement it on your own first, if this is what you need.)

Could you please be more specific about what you're after to have a better help for your needs? Can you show what is the result you have and what you expected instead? What are these special control characters exactly that are not supposed to be there?

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...