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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:10:30+00:00 2026-05-15T04:10:30+00:00

How can I comment multiple lines in Ruby?

  • 0

How can I comment multiple lines in Ruby?

  • 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-15T04:10:31+00:00Added an answer on May 15, 2026 at 4:10 am
    #!/usr/bin/env ruby
    
    =begin
    Every body mentioned this way
    to have multiline comments.
    
    The =begin and =end must be at the beginning of the line or
    it will be a syntax error.
    =end
    
    puts "Hello world!"
    
    <<-DOC
    Also, you could create a docstring.
    which...
    DOC
    
    puts "Hello world!"
    
    "..is kinda ugly and creates
    a String instance, but I know one guy
    with a Smalltalk background, who
    does this."
    
    puts "Hello world!"
    
    ##
    # most
    # people
    # do
    # this
    
    
    __END__
    
    But all forgot there is another option.
    Only at the end of a file, of course.
    
    • This is how it looks (via screenshot) – otherwise it’s hard to interpret how the above comments will look. Click to Zoom-in:

    Comments in a text-editor

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

Sidebar

Related Questions

Can I comment out lines which have other comments? /* * comment 1 */
I have a token definition that can contain multiple lines (something like multi line
In python to comment-out multiple lines we use triple quotes def x(): This code
Can anyone please tell/suggest me how can i store and retrieve comments multiple/different values
I have a function where I can add articles and users can comment on
If I integrate Facebook Connect on my website so Facebook users can comment on
i am developing a website on writing reports ...users can comment on a report
I'm trying to write a commenting system, where people can comment on other comments,
Possible Duplicate: Can I comment a JSON file? We are using a .json file
Sorry for my English. How I can add comment to Jpeg file to COM-marker

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.