From the course: Nail Your C# Interview

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Create algorithm-driven strings in C#

Create algorithm-driven strings in C# - C# Tutorial

From the course: Nail Your C# Interview

Create algorithm-driven strings in C#

- [Instructor] Another standard programing task is to create a new string based on input data. We've seen this a bit previously with toLower where a string is inputted into the function and a new string is created using the data from the input string. This was built into the standard library but let's try creating our own function that dynamically builds a string using input data. The algorithm we'll create will build the reverse of whatever string is inputted. It'll reverse the string. Now we'll want to cover our base cases where the string is null or empty. And we'll use a built-in function to do that. When starting your software development journey, sometimes it can feel like you're cheating by using the functions built into the language or the standard library but this is not cheating. Software engineering is about using the best tools for the job to create the most accurate output through the most efficient…

Contents