﻿String.prototype.explode = function( pattern )
{
	tmp = new Array;
	tmpStr = '';

	for(_i=0; _i<=this.length; _i++)
	{
		if( _i == this.length || this.charAt(_i) == pattern )
		{
			tmp.push( tmpStr );
			tmpStr = '';
		}
		else
		{
			tmpStr += this.charAt(_i);
		}
	}

	return tmp;
}

// String megfordítása
String.prototype.reverse = function()
{
	var reversed = "";

	for(i=this.length-1; i>=0; i--)
	{
		reversed += this.slice(i, i+1);
	}

	return reversed;
}

String.prototype.addSlashes = function()
{
	var tmp = this.replace(/\'/g,'\\\'');
	tmp = tmp.replace(/\"/g,'\\"');
	tmp = tmp.replace(/\0/g,'\\0');

	return tmp;
}