Include file:

#include "mcrl2/utilities/text_utility.h"

String manipulation 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.


  • 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.


  • 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)

Read text from a stream.


  • 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.


  • x Some expression

Pre: type T has operator <<

Returns: The string representation of x.