tolower
#2

Да. Вот:
Code:
stock
	ucfirst(string[])
{
	string[0] = toupper(string[0]);
	const dist = 'A' - 'a';
	for(new i = 1, len = strlen(string), c; i < len; ++i)
	{
		if ('A' <= (c = string[i]) <= 'Z')
			c -= dist;
		string[i] = c;
	}
}
P.S. Я бы ещё сделал поддержку упакованных строк...
Reply


Messages In This Thread
tolower - by Johhnyllll - 12.11.2016, 17:04
Re: tolower - by VVWVV - 12.11.2016, 17:26
Re: tolower - by Johhnyllll - 12.11.2016, 17:27
Re: tolower - by VVWVV - 12.11.2016, 17:41
Re: tolower - by Johhnyllll - 12.11.2016, 18:59
Re: tolower - by OKStyle - 13.11.2016, 04:35
Re: tolower - by ZiGGi - 13.11.2016, 04:57
Re: tolower - by Richard_Gere - 13.11.2016, 09:07
Re: tolower - by Johhnyllll - 13.11.2016, 09:14
Re: tolower - by ZiGGi - 13.11.2016, 10:21
Re: tolower - by Richard_Gere - 13.11.2016, 10:30
Re: tolower - by VVWVV - 13.11.2016, 11:03
Re: tolower - by Richard_Gere - 13.11.2016, 11:15
Re: tolower - by ZiGGi - 13.11.2016, 11:16
Re: tolower - by Richard_Gere - 13.11.2016, 11:22
Re: tolower - by VVWVV - 13.11.2016, 11:35
Re: tolower - by Richard_Gere - 13.11.2016, 11:42
Re: tolower - by VVWVV - 13.11.2016, 11:56
Re: tolower - by White_116 - 13.11.2016, 15:20
Re: tolower - by ZiGGi - 13.11.2016, 15:58
Re: tolower - by White_116 - 13.11.2016, 17:16

Forum Jump:


Users browsing this thread: 6 Guest(s)