protected String replaceAllWords(String S, String strWhat, String strWith)

	{



		if(separators == null || S == null || strWhat.equals(strWith))

			return S;



		int pos;

		int begin = 0;

		String returnS = S;

		String before;

		String after;



		while((pos = S.indexOf(strWhat, begin)) != -1)

		{

			before = " ";

			after = " ";

			if(pos > 0 && pos < S.length() -1)

			{

				before = S.substring(pos - 1, pos);

				after = S.substring(pos + strWhat.length(), pos + strWhat.length() + 1);

			}

			// compare to whitespace character combinations

			if( !(equalsSeparator(before) && equalsSeparator(after)) )

			{

				begin = pos + strWhat.length();

				continue;// is not surrounded by whitespace - no replace

			}

			returnS = S.substring(0, pos) + strWith + S.substring(pos + strWhat.length());

			begin = pos + strWith.length();

			S = returnS;

		}

		return returnS;

	}