Skip to content

KrylixZA/WhitespaceTrim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Whitespace Trim

A simple Test-Driven implementation of a Whitespace Trimming code Kata

The Kata

When editing text files often times one ends up putting extra spaces and tabs at the end of each line. Develop a simple algorithm to remove these extra characters. It shall take an input string and produce a right-trimmed output string.

Examples

  • "abc" -> "abc"
  • “abc “ -> “abc”
  • "abc\t" -> "abc"
  • " abc" -> " abc" (does not remove beginning whitespace)
  • "ab\r\n cd \r\n" -> "ab\r\ncd\r\n" (removes whitespace at end of second line)
  • “\r\n” -> “\r\n”
Credit

All credit goes to Chillisoft who provided me with the Katas and the training to solve these problems.

About

A simple Test-Driven implementation of a Whitespace Trimming code Kata

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages