tail remove newline

C++
tr -d '\n'
Source

Also in C++: