quote:
Originally posted by Burningmace
To uppercase the first character after you've detected that the fist character is indeed within the range a-Z you can do this:
code:
message = message.charAt(0).toUpper() + message.substr(1);
This bit I had already sorted out.
Basically, here's what I already have and yes I know this all could probably be done MUCH more simply but like I said, I normally program databases in VB so I have NO experience with JScript etc.
code:
function OnEvent_ChatWndSendMessage(pChatWnd, Message){
var endChar = Message.charAt(Message.length-1)
switch (endChar)
{
case "!":
endChar = ""
break;
case "?":
endChar = ""
break;
case ".":
endChar = ""
break;
case ")":
endChar = ""
break;
case ":":
endChar = ""
break;
default:
endChar = "."
}
Message = Message.substr(0,1).toUpperCase() + Message.substr(1) + endChar
return Message;
}