# mcrl2/utilities/text_utility.h¶

Include file:

#include "mcrl2/utilities/text_utility.h"


String manipulation functions.

## Functions¶

std::string mcrl2::utilities::number2string(std::size_t number)

Convert a number to string.

This function is much faster than std::to_string and its use is therefore preferred in those cases were performance counts.

Parameters:

• number A number to be transformed.
void mcrl2::utilities::number2string(std::size_t number, std::string &buffer, std::size_t start_position)

Convert a number to a string in the buffer starting at position start_position.

Parameters:

• number The number to be converted.
• buffer A buffer in which the string will be stored that is sufficiently large.
• start_position The first position where a number is written.
std::string mcrl2::utilities::read_text(std::istream &in)

Parameters:

• in An input stream

Returns: The text read from the stream

std::string mcrl2::utilities::string_join(const Container &c, const std::string &separator)

Joins a sequence of strings. This is a replacement for boost::algorithm::join, since it gives stack overflow errors with Visual C++ express 9.0 under some circumstances.

std::string mcrl2::utilities::to_string(const T &x)

Transform parameter into string.

Parameters:

• x Some expression

Pre: type T has operator <<

Returns: The string representation of x.