{"id":16565177,"url":"https://github.com/shonharsh/csharp-exercism-s03e01-strings-loglevels","last_synced_at":"2026-04-13T05:46:08.172Z","repository":{"id":244441298,"uuid":"815254073","full_name":"ShonHarsh/CSharp-Exercism-S03E01-Strings-LogLevels","owner":"ShonHarsh","description":"Exercism - This C# project is regarding strings and processing logs.","archived":false,"fork":false,"pushed_at":"2024-06-17T22:06:40.000Z","size":135,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T21:27:05.286Z","etag":null,"topics":["academic","artificial-intelligence","atom","automation","bot","config","csharp","education","git","guide","learning","logging","markdown","process","strings","studio","testing","training-materials","trending","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShonHarsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-14T17:31:03.000Z","updated_at":"2024-06-22T01:46:02.000Z","dependencies_parsed_at":"2025-01-15T20:37:31.302Z","dependency_job_id":"a3cb8382-c52b-4afe-bd39-d820b3f4ab44","html_url":"https://github.com/ShonHarsh/CSharp-Exercism-S03E01-Strings-LogLevels","commit_stats":null,"previous_names":["shonharsh/csharp-exercism-s03e01-strings-loglevels"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShonHarsh%2FCSharp-Exercism-S03E01-Strings-LogLevels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShonHarsh%2FCSharp-Exercism-S03E01-Strings-LogLevels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShonHarsh%2FCSharp-Exercism-S03E01-Strings-LogLevels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShonHarsh%2FCSharp-Exercism-S03E01-Strings-LogLevels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShonHarsh","download_url":"https://codeload.github.com/ShonHarsh/CSharp-Exercism-S03E01-Strings-LogLevels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241992577,"owners_count":20054352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["academic","artificial-intelligence","atom","automation","bot","config","csharp","education","git","guide","learning","logging","markdown","process","strings","studio","testing","training-materials","trending","windows"],"created_at":"2024-10-11T20:46:19.333Z","updated_at":"2025-12-31T00:56:56.400Z","avatar_url":"https://github.com/ShonHarsh.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Banner](Data/Images/CSharp-Exercism-S03E01-Strings-LogLevels-Banner.png)\n\n### CSharp-Exercism-S03E01-Strings-LogLevels\n\nThis repository my work for the [Exercism](https://exercism.org/) C# track.\n\n### Download Command\n`exercism download --track=csharp --exercise=log-levels`\n\n### Submission Command\n`exercism submit \"Exercism\\csharp\\log-levels\\LogLevels.cs\"`\n\n![Banner](Data/Images/CSharp-Exercism-S03-Strings-Title.png)\n\n# Log Levels\n\nWelcome to Log Levels on Exercism's C# Track.\nIf you need help running the tests or submitting your code, check out `HELP.md`.\nIf you get stuck on the exercise, check out `HINTS.md`, but try and solve it without using those first :)\n\n## Introduction\n\n## Strings\n\nA `string` in C# is an object that represents immutable text as a sequence of Unicode characters (letters, digits, punctuation, etc.). Double quotes are used to define a `string` instance:\n\n```csharp\nstring fruit = \"Apple\";\n```\n\nStrings are manipulated by calling the string's methods. Once a string has been constructed, its value can never change. Any methods that appear to modify a string will actually return a new string.\n\nMultiple strings can be concatenated (added) together. The simplest way to achieve this is by using the `+` operator.\n\n```csharp\nstring name = \"Jane\";\n\"Hello \" + name + \"!\";\n// =\u003e \"Hello Jane!\"\n```\n\nFor any string formatting more complex than simple concatenation, string interpolation is preferred. To use interpolation in a string, prefix it with the dollar (`$`) symbol. Then you can use curly braces (`{}`) to access any variables inside your string.\n\n```csharp\nstring name = \"Jane\";\n$\"Hello {name}!\";\n// =\u003e \"Hello Jane!\"\n```\n\n## Instructions\n\nIn this exercise you'll be processing log-lines.\n\nEach log line is a string formatted as follows: `\"[\u003cLEVEL\u003e]: \u003cMESSAGE\u003e\"`.\n\nThere are three different log levels:\n\n- `INFO`\n- `WARNING`\n- `ERROR`\n\nYou have three tasks, each of which will take a log line and ask you to do something with it.\n\n## 1. Get message from a log line\n\nImplement the (_static_) `LogLine.Message()` method to return a log line's message:\n\n```csharp\nLogLine.Message(\"[ERROR]: Invalid operation\")\n// =\u003e \"Invalid operation\"\n```\n\nAny leading or trailing white space should be removed:\n\n```csharp\nLogLine.Message(\"[WARNING]:  Disk almost full\\r\\n\")\n// =\u003e \"Disk almost full\"\n```\n\n## 2. Get log level from a log line\n\nImplement the (_static_) `LogLine.LogLevel()` method to return a log line's log level, which should be returned in lowercase:\n\n```csharp\nLogLine.LogLevel(\"[ERROR]: Invalid operation\")\n// =\u003e \"error\"\n```\n\n## 3. Reformat a log line\n\nImplement the (_static_) `LogLine.Reformat()` method that reformats the log line, putting the message first and the log level after it in parentheses:\n\n```csharp\nLogLine.Reformat(\"[INFO]: Operation completed\")\n// =\u003e \"Operation completed (info)\"\n```\n\n## Source\n\n### Created by\n\n- @ErikSchierboom\n\n### Contributed to by\n\n- @yzAlvin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshonharsh%2Fcsharp-exercism-s03e01-strings-loglevels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshonharsh%2Fcsharp-exercism-s03e01-strings-loglevels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshonharsh%2Fcsharp-exercism-s03e01-strings-loglevels/lists"}