Skip to content

To Ruby from Python - f-strings/expression substitution #3073

@mheguy-stingray

Description

@mheguy-stingray

Heya,

I'm brand new to Ruby so I hope I'm not mistaken with this issue.

I was looking at this page: https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-python/

The fourth point in "differences" is:

... a special “expression substitution” syntax (which allows you to insert the results of Ruby expressions directly into other strings without having to "add " + "strings " + "together"). ...

I get the sense that the expression substitution is the same as f-strings in Python which were introduced in 3.6. f"Hello {name}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions