Shoutbox

Capital Letter - More - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Capital Letter - More (/showthread.php?tid=63777)

Capital Letter - More by FoxTheFox on 07-22-2006 at 11:03 AM

Hello

I modified the script to add a checking.
If the sentences finish by one "?","!","+" or ".", the script does not add the ".".

Edit your script :

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
if ( sMessage.charAt(sMessage.length - 1) == "?" || sMessage.charAt(sMessage.length - 1) == "!" || sMessage.charAt(sMessage.length - 1) == "." || sMessage.charAt(sMessage.length - 1) == "+" ){
sMessage = sMessage.substr(0,1).toUpperCase() + sMessage.substr(1)
}
else {
sMessage = sMessage.substr(0,1).toUpperCase() + sMessage.substr(1) + '.'
}
return sMessage;
}