Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow format strings in ThisAssembly.Strings #313

Merged
merged 1 commit into from
Jun 9, 2024
Merged

Allow format strings in ThisAssembly.Strings #313

merged 1 commit into from
Jun 9, 2024

Conversation

kzu
Copy link
Member

@kzu kzu commented Jun 9, 2024

The following are now valid and produce the expected results, just as an equivalent interpolated string would:

  • expires on {date:yyyy-MM-dd}
  • expires on year {date:yyyy} (wait until {date:MM}
  • expires on {0:yyyy-MM}

Note how the same argument name can be used multiple times with different output formatting for increased flexibility and arg reuse.

Fixes #299

The following are now valid and produce the expected results, just as an equivalent interpolated string would:

- `expires on {date:yyyy-MM-dd}`
- `expires on year {date:yyyy} (wait until {date:MM}`
- `expires on {0:yyyy-MM}`

Note how the same argument name can be used multiple times with different output formatting for increased flexibility and arg reuse.

Fixes #299
@kzu kzu added the enhancement New feature or request label Jun 9, 2024
@kzu kzu merged commit 16098d8 into main Jun 9, 2024
7 checks passed
@kzu kzu deleted the format branch June 9, 2024 06:38
@devlooped devlooped locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow format strings in ThisAssembly.Strings
1 participant