a character representing one or more of the sounds used in speech; any of the symbols of an alphabet.
Questions tagged [letter]
448 questions
236
votes
45 answers
How to capitalize the first letter of a string in dart?
How do I capitalize the first character of a string, while not changing the case of any of the other letters?
For example, "this is a string" should give "This is a string".

Kasper
- 12,594
- 12
- 41
- 63
220
votes
10 answers
python capitalize first letter only
I am aware .capitalize() capitalizes the first letter of a string but what if the first character is a integer?
this
1bob
5sandy
to this
1Bob
5Sandy

user1442957
- 7,191
- 5
- 22
- 19
196
votes
9 answers
What is the best way to tell if a character is a letter or number in Java without using regexes?
What is the best and/or easiest way to recognize if a string.charAt(index) is an A-z letter or a number in Java without using regular expressions? Thanks.

Daniel Sopel
- 3,535
- 4
- 24
- 17
171
votes
17 answers
How to check if character is a letter in Javascript?
I am extracting a character in a Javascript string with:
var first = str.charAt(0);
and I would like to check whether it is a letter. Strangely, it does not seem like such functionality exists in Javascript. At least I cannot find it.
How can I…

Jérôme Verstrynge
- 57,710
- 92
- 283
- 453
82
votes
4 answers
How do I count the letters in Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch?
How do I count the letters in Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch?
print(len('Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch'))
Says 58
Well if it was that easy I wouldn't be asking you, now would I?!
Wikipedia…

Madarch
- 831
- 4
- 5
45
votes
6 answers
How to detect lowercase letters in Python?
I need to know if there is a function that detects the lowercase letters in a string. Say I started writing this program:
s = input('Type a word')
Would there be a function that lets me detect a lowercase letter within the string s? Possibly ending…

JustaGuy313
- 533
- 2
- 6
- 11
42
votes
9 answers
Regex capitalize first letter every word, also after a special character like a dash
I use this to capitalize every first letter every word:
#(\s|^)([a-z0-9-_]+)#i
I want it also to capitalize the letter if it's after a special mark like a dash (-).
Now it shows:
This Is A Test For-stackoverflow
And I want this:
This Is A Test…

Simmer
- 421
- 1
- 4
- 5
41
votes
3 answers
In VB6 what is the difference between Property Set and Property Let?
I have just created several Property Set methods, and they didn't compile. When I changed them to Property Let, everything was fine.
I have since studied the documentation to find the difference between Property Set and Property Let, but must admit…

Brian Hooper
- 21,544
- 24
- 88
- 139
18
votes
6 answers
Immediately show autocomplete on Android
The Android autocomplete only starts after two letters. How can I make it so the list appears when the field is just selected?

Mitchell
- 929
- 2
- 11
- 34
18
votes
2 answers
Randomly choosing from a list with weighted probabilities
I have an array of N elements (representing the N letters of a given alphabet), and each cell of the array holds an integer value, that integer value meaning the number of occurrences in a given text of that letter. Now I want to randomly choose a…

Setzer22
- 1,589
- 2
- 13
- 29
17
votes
7 answers
How can I check if a char is a letter or a number?
I have a string and I want to loop it so that I can check if every char is a letter or number.
$s = "rfewr545 345b";
for ($i=1; $i<=strlen($s); $i++){
if ($a[$i-1] == is a letter){
echo $a[$i-1]." is a letter";
} else {
echo…

gadss
- 21,687
- 41
- 104
- 154
16
votes
1 answer
How to access Letter Recognizer API in Android?
I am creating a gesture application.
In the Gesture class docs http://developer.android.com/reference/android/gesture/Gesture.html) it reads:
"A user-defined gesture can be recognized by a GestureLibrary and a
built-in alphabet gesture can be…

Navigatron
- 2,065
- 6
- 32
- 61
13
votes
6 answers
Determine if string starts with letters A through I
I've got a simple java assignment. I need to determine if a string starts with the letter A through I. I know i have to use string.startsWith(); but I don't want to write, if(string.startsWith("a")); all the way to I, it seems in efficient. Should I…

Archey
- 1,312
- 5
- 15
- 21
11
votes
3 answers
Automatically capitalize first letter of first word in a new sentence in LaTeX
I know one of LaTeX's bragging points is that it doesn't have this Microsoftish behavior. Nevertheless, it's sometimes useful.
LaTeX already adds an extra space after you type a (non-backslashed) period, so it should be possible to make it…

memius
- 4,045
- 5
- 26
- 25
8
votes
5 answers
One letter game Issue?
Recently at a job interview I was given the following problem:
Write a script capable of running on the command line as python
It should take in two words on the command line (or optionally if you'd prefer it can query the user to supply the two…

Alex Ksikes
- 369
- 2
- 11