Skip to content

Berry f-strings now support '::' in expression#526

Open
s-hadinger wants to merge 1 commit into
berry-lang:masterfrom
s-hadinger:fstring_double_colon
Open

Berry f-strings now support '::' in expression#526
s-hadinger wants to merge 1 commit into
berry-lang:masterfrom
s-hadinger:fstring_double_colon

Conversation

@s-hadinger
Copy link
Copy Markdown
Contributor

Description:

Berry, now f-strings supports ':' in expression, if double as '::'.

Example:

var is_on = true
var s = f"status = {is_on ? 'on' :: 'off'}"
# s is 'status = on'

f"status = {is_on ? 'on' :: 'off'}" is equivalent to format("status = %s", is_on ? 'on' : 'off')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant