Posts in tag

Strings


Programmers sometimes need to trim, or remove, characters, such as spaces from strings. It might be a surprising expensive task. In C, the following function is efficient: size_t trimspaces(const char *s, size_t len, char *out) { char * init_out{out}; for(size_t i = 0; i < len; i++) { *out = s[i]; out += (s[i] != …

Rental real estate is renowned for its many tax breaks, and the 2017 tax overhaul added a new one. Landlords who want to claim it for 2019 should be planning now, because they may need to send 1099 forms early next year. The benefit is the so-called 199A deduction of 20%. It applies to business …