When to use the terms “delimiter,” “terminator,” and “separator”

A delimiter denotes the limits of something, where it starts and where it ends. For example: “this is a string” has two delimiters, both of which happen to be the double-quote character. The delimiters indicate what’s part of the thing, and what is not. A separator distinguishes two things in a sequence: one, two 1\t2 … Read more

HTML + CSS: Ordered List without the Period?

This is perfectly possible to do with just CSS (2.1): ol.custom { list-style-type: none; margin-left: 0; } ol.custom > li { counter-increment: customlistcounter; } ol.custom > li:before { content: counter(customlistcounter) ” “; font-weight: bold; float: left; width: 3em; } ol.custom:first-child { counter-reset: customlistcounter; } Keep in mind that this solution relies on the :before pseudo-selector, … Read more

How can I print a list of elements separated by commas?

Use an infix_iterator: // infix_iterator.h // // Lifted from Jerry Coffin’s ‘s prefix_ostream_iterator #if !defined(INFIX_ITERATOR_H_) #define INFIX_ITERATOR_H_ #include <ostream> #include <iterator> template <class T, class charT=char, class traits=std::char_traits<charT> > class infix_ostream_iterator : public std::iterator<std::output_iterator_tag,void,void,void,void> { std::basic_ostream<charT,traits> *os; charT const* delimiter; bool first_elem; public: typedef charT char_type; typedef traits traits_type; typedef std::basic_ostream<charT,traits> ostream_type; infix_ostream_iterator(ostream_type& s) : … Read more

Adding Thousand Separator to Int in Swift

You can use NSNumberFormatter to specify a different grouping separator as follow: update: Xcode 11.5 • Swift 5.2 extension Formatter { static let withSeparator: NumberFormatter = { let formatter = NumberFormatter() formatter.numberStyle = .decimal formatter.groupingSeparator = ” ” return formatter }() } extension Numeric { var formattedWithSeparator: String { Formatter.withSeparator.string(for: self) ?? “” } } … Read more

Separators for Navigation

If there isn’t a pressing need to use images for the separators, you could do this with pure CSS. nav li + li:before{ content: ” | “; padding: 0 10px; } This puts a bar between each list item, just as the image in the original question described. But since we’re using the adjacent selectors, … Read more