Ask Ben: Javascript String Replace Method

function RandomString2( 
	strTargetInstance // This is the target string match instance.
	){
	var arrLetters = ["A","B","C","D","E","V","W","X","Y","Z"];
	var intLetter = (Math.floor( Math.random() * 10 ) % 9);
	 
	// Return the random letter string we get from the 
	// array of letters above. This time, though, we are
	// going to include the target string to demonstrate
	// that it has been passed in.
	return( "[" + strTargetInstance + " : " + arrLetters[ intLetter ] + "]" );
}

For Cut-and-Paste