Closed ErikSchierboom closed 4 years ago
Please have a look at the instructions.
This is based on Elixir's strings
exercise.
Tasks 1 and 3 push towards string interpolation.
Task 2 pushes towards string.Format()
and verbatim strings.
Yes, I like it! 👍
closed with PR #1871
This issue describes how to implement the
string-formatting
concept exercise for the C# track.Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Please also watch the following video:
Goal
The goal of this exercise is to teach the student the basics of the Concept of String formatting in C#.
Learning objectives
ToString()
method to convert any object to astring
.string.Format
underlies string interpolation.StringBuilder
type and when to use it.Out of scope
Nothing.
Concepts
This Concepts Exercise's Concepts are:
string-formatting
: know how to use theToString()
method to convert any object to astring
; know how to use string interpolation on values of any type; know how to use default format strings to convert to standard output formats; know how to use custom format strings to convert to custom output formats; know thatstring.Format
underlies string interpolation; know of theStringBuilder
type and when to use it; know that string interpolation can interpolate any expression.Prequisites
This Concept Exercise's prerequisites Concepts are:
strings
: strings will be formatted.inheritance
: knowing that each class derives fromobject
and thus has built-in methods.Any data types used in this exercise (e.g.
datetimes
) should also be added as prerequisites.Resources to refer to
Hints
After
FormattableString
class.Representer
This exercise does not require any specific representation logic to be added to the representer.
Analyzer
This exercise does not require any specific analyzer logic to be added to the analyzer.
Implementing
To implement this exercise, please follow these instructions.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.