/*========================================================================================
* collection of string utils
*
* @copyright	www.monogroup.ro
* @author		Cosmin Cimpoi <cosmin dot cimpoi at monogroup dot ro>
*=========================================================================================*/

/* indent a given number with n zeros in order to return a string of a given length
*  usefil when you need to read files named like: "screen013.jpg" and you have the number 13 to start with
*/
function stringIndentZeros(givenNumber, targetLength)
{
	var resultedString = givenNumber + '';
	while(resultedString.length < targetLength){
		resultedString = '0'.concat(resultedString);// = concat('0', resultedString);
	}
	return resultedString;
}

function stripChar(givenString, strippedChar)
{
	var stripped = false;
	while(!stripped){
		stripped = true;
		iof = givenString.indexOf(strippedChar);
		document.writeln(iof + ' | ');
		if(iof != -1){
			givenString = givenString.substring(0, iof) + givenString.substring(iof+1);
			stripped = false;
		}
	}
	return givenString;
}