Modcraft - The community dedicated to quality WoW modding!
Community => Random => Topic started by: Yolo33 on July 03, 2015, 10:20:39 pm
-
ww3
-
Hi, does someone know a script for Autohotkey or could make me a program that auto capitalizes only the first letter of a sentence? I would really appreciate it.
A program? Most of the free editor do this...or..did I missed the topic ;)?
-
std::string input;
bool new_sentence (true);
for (std::string::iterator it (input.begin()); it != input.end(); ++it)
{
if (new_sentence && std::isalpha (*it))
{
*it = std::toupper (*it);
new_sentence = false;
}
else if (*it == '.') // possibly more sentence separators
{
new_sentence = true;
}
}
Untested, unclear definition of "new sentence", not entirely sure, but probably a acceptable start.
-
If you're working in CodeBlocks you can do that:
#include <iostream>
#include <ctype.h>
using namespace std;
int main()
{
char c[] = "your sentence.";
c[0] = toupper(c[0]);
cout << c;
return 0;
}
That's what we are learning in my country in high school.
-
be possible?