I be looking for a writist.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=35358.msg505683#msg505683
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=35358.msg505683#msg505683
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: BOYD1981 on Sat 14/03/2009 19:47:41
right now we're interested in keeping it to the Stickam/TokBox regulars because we already all know eachother.
Quote from: Pumaman on Fri 13/03/2009 23:29:18
You need to use a "if (namestring.IndexOf(".") >= 0" check to get the behaviour you want.
Quote from: Pumaman on Fri 13/03/2009 23:29:18
Anyway, rather than having a list of punctuation characters that you want to ban, it's simpler to define a list of safe characters that you want to allow -- eg. A-Z and a space.
Quote from: Pumaman on Fri 13/03/2009 23:29:18
What do you mean? Why do you need to use EndsWith?
Quote from: Zooty on Fri 13/03/2009 16:23:07
Was this Swordwielder or Goldies problem?
Quote from: AtheistChase on Fri 13/03/2009 12:39:35
You keep an elephant in your pants?
Quote from: AtheistChase on Fri 13/03/2009 12:52:03
I keep losing mine.
Quote from: woot52 on Thu 12/03/2009 18:57:21I like turtles.
I like Lost...
Quote from: Buckethead on Thu 12/03/2009 22:17:43Quote from: Ultra Magnus on Wed 11/03/2009 00:39:06
I only do magic to pick up girls.
I'm not a weirdo.
getting a snake out of your trousers is not magic
Quote from: InCreator on Fri 13/03/2009 00:09:27
Does christianity disapprove humor?
Quote from: Pumaman on Wed 11/03/2009 18:52:01
Use two Substring calls to get the left and the right parts of the string either side of the character you want to remove, then join them back together.
String NixCharacter (int characterIndex)
{
int e = namestring.Length;
String namestringend = namestring.Substring(characterIndex + 1, e);
namestring = namestring.Truncate(characterIndex);
namestring = namestring.Append(namestringend);
return namestring;
}
//main code
namestring = namestring.LowerCase();
namestring = CapitaliseLetter(0);
int i = 0;
while (i < namestring.Length)
{
if (namestring.Chars[i] == ' ' || namestring.Chars[i] == '-') {
if (namestring.Chars[i+1] == ' ' || namestring.Chars[i+1] == '-') {namestring = NixCharacter(i); i--;}
else {namestring = CapitaliseLetter(i + 1);}
else if (namestring.Chars[i] > '0' && namestring.Chars[i] < '9') {namestring = NixCharacter(i); i--;}
i++;
}
String CapitaliseLetter(int characterIndex)
{
if (characterIndex < namestring.Length)
{
String namestringtemp = namestring.UpperCase();
char capitalCharacter = namestringtemp.Chars[characterIndex];
namestring = namestring.ReplaceCharAt(characterIndex, capitalCharacter);
}
return namestring;
}
function myNamePlayer()
{
namestring=txtNameinput.Text;
if (namestring=="") {
SetTextWindowGUI (5);
DisplayAtY(402, "Please enter a name before proceeding.");
SetTextWindowGUI (16);
}
else {
namestring = namestring.LowerCase();
namestring = CapitaliseLetter(0);
int i = 0;
while (i < namestring.Length)
{
if (namestring.Chars[i] == ' ' || namestring.Chars[i] == '-') namestring = CapitaliseLetter(i + 1);
i++;
}
cStephanie.Say("It's nice to meet you, %s.", namestring);
}
}
if (namestring.Chars[i] > '0' && namestring.Chars[i] < '9') namestring = namestring.ReplaceCharAt(i, );
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.144 seconds with 16 queries.