Questions tagged [letters]

258 questions
27
votes
5 answers

Bash script to find the frequency of every letter in a file

I am trying to find out the frequency of appearance of every letter in the english alphabet in an input file. How can I do this in a bash script?
SkypeMeSM
  • 2,876
  • 7
  • 40
  • 59
21
votes
3 answers

Capital letters in class name PHP

I have two classes in my system. One is called file and second is File. On my localhost when i instantiate file i get file object, but my friend running the same script gets object of File like the capital letters were unrecognized and "file" was…
Somal
  • 211
  • 1
  • 2
  • 3
19
votes
5 answers

simplest, shortest way to count capital letters in a string with php?

I am looking for the shortest, simplest and most elegant way to count the number of capital letters in a given string.
pablo
  • 701
  • 4
  • 7
  • 14
16
votes
4 answers

Sequence of letters in Python

Is there a built-in method / module in Python to generate letters such as the built-in constant LETTERS or letters constant in R? The R built-in constant works as letters[n] where if n = 1:26 the lower-case letters of the alphabet are…
John
  • 32,659
  • 27
  • 74
  • 102
14
votes
7 answers

What is the best way to match only letters in a regex?

I would really like to use \w but it also matches underscores so I'm going with [A-Za-z] which feels unnecessarily verbose and America centric. Is there a better way to do this? Something like [\w^_] (I doubt I got that syntax right)?
SapphireSun
  • 8,236
  • 10
  • 44
  • 56
13
votes
4 answers

OrderBy with Swedish letters

I have a list of my custom class Customer and I want to sort them alphabetically by Title. So I wrote myList = myList.OrderByDescending(x => x.Title).ToList(); Now the problem is that this method doesn't support the Swedish way of…
Dudute
  • 337
  • 1
  • 3
  • 11
12
votes
8 answers

How do I get the set of all letters in Java/Clojure?

In Python, I can do this: >>> import string >>> string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' Is there any way to do something similar in Clojure (apart from copying and pasting the above characters somewhere)? I looked…
Jason Baker
  • 171,942
  • 122
  • 354
  • 501
8
votes
2 answers

A loop to create the alphabet using JavaScript

I've been working on a small project for myself, and it consists of creating the alphabet. I don't want to hard code each individual letter in markup, but rather use JavaScript to do it for me. This is how far I've gotten. for ( i = 0; i < 26; i++…
John Connor
  • 135
  • 1
  • 2
  • 6
7
votes
2 answers

OrderBy ignoring accented letters

I want a method like OrderBy() that always orders ignoring accented letters and to look at them like non-accented. I already tried to override OrderBy() but seems I can't do that because that is a static method. So now I want to create a custom…
Ninita
  • 1,081
  • 1
  • 16
  • 39
6
votes
10 answers

python: How do I assign values to letters?

I want to assign a value to each letter in the alphabet, so that a -> 1, b -> 2, c -> 3, ... z -> 26. Something like a function which returns the value of the letter, for example: value('a') = 1 value('b') = 2 etc... How would I go about doing this…
Eddy
  • 5,821
  • 18
  • 54
  • 70
5
votes
4 answers

How to iterate through alpha and numeric numbers

I would like to know how in Python I can iterate through a set of conditions. string that has 2-6 lower alpha or numeric characters the first character is always a number So a short progression would…
Ryan
  • 157
  • 1
  • 2
  • 12
5
votes
4 answers

PHP: is there an isLetter() function or equivalent?

I am no PHP expert. I am looking for the PHP equivalent of isLetter() in Java, but I can't find it. Does it exist? I need to extract letters from a given string and make them lower case, for example: "Ap.ér4i5T i6f;" should give "apéritif'. So, yes,…
Jérôme Verstrynge
  • 51,859
  • 84
  • 263
  • 429
5
votes
6 answers

Linq query - find strings based upon first letter b/w two ranges

We have a list containing names of countries. We need to find names of countries from list b/w two letters. Like names of all countries with name starting b/w A-G and so on. We create following linq query but its ugly. var countryAG = from elements…
Malik
  • 339
  • 1
  • 11
  • 26
5
votes
4 answers

MySQL - Case-insensitive search

Building my search engine for users to search for three variables $Title, $Text and $Number... How do i make it when user searches it finds all results no matter the case type (lower or upper case) user typed in $query? $query = trim…
user2129470
  • 47
  • 1
  • 1
  • 5
4
votes
6 answers

Condense list into string : ['z','y','x'...] -> 'zyx...' ? Python (2.7.1)

If I have list='abcdedcba' and i want: a=z, b=y, c=x, d=w, e=v so it would translate to: translate='zyxwvwxya' How would I do this? If I construct a dictionary >>> d=dict(zip(('a','b','c','d','e'),('z','y','x','w','v'))) and type >>> example= d[x]…
O.rka
  • 24,289
  • 52
  • 152
  • 253
1
2 3
17 18