-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unwrite() to CodeWriter to help with CSVs
It's sometimes easier to deal with comma separated values by just always throwing a ", " at the end of each element in the list, even for the last element. The unwrite() method allows you to remove the last text written to the CodeWriter if it matches a given substring. This allows, for example, ", " to be "unwritten" to removing the trailing comma without having to first check if the last text written was a trailing comma. This is similar to Ruby's chomp() method.
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters