C strip comments

Duration: 8min 20sec Views: 1689 Submitted: 08.01.2020
Category: RolePlay
Join Stack Overflow to learn, share knowledge, and build your career. Connect and share knowledge within a single location that is structured and easy to search. I just want the source code with comments stripped, nothing else should be changed. Preference towards an existing tool. I don't want to have to write this myself with regexes, I foresee too many surprises in the code. It depends on how perverse your comments are.

Strip comments from a string

Strip comments from a string - Rosetta Code

The task is to remove text that follow any of a set of comment markers, in these examples either a hash or a semicolon from a string or input line. Some other languages might be incorrect for the same reason. Please discuss this issue at Talk:Strip comments from a string. It was always said in discussion, the task is not really stripping comments. It's only a truncation.

Subscribe to RSS

Work fast with our official CLI. Learn more. If nothing happens, download GitHub Desktop and try again.
It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search. Yes, I could do it by hand, but that seems needlessly laborious, has the potential for mistakes, and makes maintenance difficult.