MTK++ Latest version: 0.2.0

Namespaces | Functions
StringManip.cpp File Reference

Miscellaneous string manipulation functions. More...

#include "StringManip.h"
#include <sstream>
#include <cmath>
Include dependency graph for StringManip.cpp:


namespace  MTKpp

MTK++ namespace.


void MTKpp::splitString (std::string &s, const std::string s2, std::vector< std::string > &v, int i)
 Splits string.
std::string MTKpp::stripString (std::string const &str, char const *sepSet)
 Returns a string with leading/trailing characters of a set stripped.
std::string MTKpp::removeCharacter (const std::string &s, const char &c)
 Remove character from string.
std::string MTKpp::replaceCharacter (const std::string &s, const char &c, const char &n)
 Replace character in string.
std::string MTKpp::addCharacter (const std::string &s, char c, int i)
 Add character to the string.
bool MTKpp::FieldExists (std::string &s, int i, int j)
 A check to see if a file field exist or not.
std::string MTKpp::GetAlphaChar (std::string &s, int i)
 Get the first alpha character in the string.
std::string MTKpp::int2String (int i)
 Convert an int to a string.
std::string MTKpp::uLongKind2String (ULONG_KIND i)
 Convert an int to a string.
unsigned int MTKpp::string2UInt (std::string s)
 Convert a string to an unsigned integer.
int MTKpp::string2Int (std::string s)
 Convert a string to an integer.
std::string MTKpp::double2String (double d)
 Convert a double to a string.
std::string MTKpp::double2String (double d, int precision)
 Convert a double to a string.
double MTKpp::string2Double (std::string s)
 Convert a string to a double.
std::string MTKpp::toUpper (std::string s)
 Converts to upper case.
std::string MTKpp::toLower (std::string s)
 Converts to lower case.
std::string MTKpp::baseName (std::string name)
 Returns a base of the string, e.g "asdf" gets returned from "asdf.mol".
std::string MTKpp::extName (std::string e)
 Returns a file extension, e.g "mol" gets returned from "asdf.mol".
bool MTKpp::fileExists (const std::string &fileName)
 Returns a boolean if a file exists or not.
bool MTKpp::containsSubStr (const std::string &s, const std::string &ss)
 Returns a boolean if a string contains a certain sub-string.
std::string MTKpp::replaceSubStr (const std::string &s1, const std::string &s2, const std::string &s3)
 Replace part of string with another string.

Detailed Description

Miscellaneous string manipulation functions.

Andrew Wollacott
Martin Peters
2010/03/29 20:39:34


MTK++ - C++ package of modeling libraries.

Copyright (C) 2005-2006 (see AUTHORS file for a list of contributors)

This file is part of MTK++.

MTK++ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

MTK++ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lessser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <>.


Generated on Fri Dec 23 2011 09:28:53 for MTK++ by Doxygen