<SCRIPT language=javascript>

 

alert(JavascriptMid("Steve",3,"X"))

 

function JavascriptMid(OriginalString,StartPosition,ReplacementString)

   // JavascriptMid("Steve",3,"X") would produce StXve

  {

  

   StartPosition = StartPosition -1

       b = ""

       e = ""

       x = OriginalString

       b = x.substr(0,StartPosition)

       e = x.substr(StartPosition + ReplacementString.length,9999)

       return  b + ReplacementString + e

  }

 

</SCRIPT>