Questions tagged [alphabetical]

Use this tag to describe the way of ordering a sequence in the same order as the alphabet

Alphabetical describes the way of ordering a sequence of strings (letters, words...) in the same order as the alphabet. For instance, a dictionary is ordered in the alphabetical order.

cf.

731 questions
223
votes
16 answers

How can I sort a List alphabetically?

I have a List object that contains country names. How can I sort this list alphabetically?
Lennie
  • 2,429
  • 2
  • 18
  • 16
221
votes
6 answers

Python data structure sort list alphabetically

I am a bit confused regarding data structure in python; (),[], and {}. I am trying to sort a simple list, probably since I cannot identify the type of data I am failing to sort it. My list is simple: ['Stem', 'constitute', 'Sedge', 'Eflux', 'Whim',…
icypy
  • 3,062
  • 5
  • 25
  • 27
131
votes
16 answers

What is a method that can be used to increment letters?

Does anyone know of a Javascript library (e.g. underscore, jQuery, MooTools, etc.) that offers a method of incrementing a letter? I would like to be able to do something like: "a"++; // would return "b"
andyzinsser
  • 2,463
  • 2
  • 18
  • 18
126
votes
24 answers

How do I sort strings alphabetically while accounting for value when a string is numeric?

I'm trying to sort an array of numbers that are strings and I'd like them to sort numerically. The catch is that I cannot convert the numbers into int. Here is the code: string[] things= new string[] { "105", "101", "102", "103", "90" }; foreach…
sf.
  • 24,512
  • 13
  • 53
  • 58
60
votes
6 answers

Convert character to its alphabet integer position?

I'm trying to find if there is a quick way to get the integer position of a character in the alphabet (C#). I can simply create an array and get the position, but seems there must be a "nice and funky" way of acheiving this? I've also looked at…
BlueChippy
  • 5,935
  • 16
  • 81
  • 131
49
votes
2 answers

How to create an alphabetical scrollbar displaying all the letter in android?

My purpose is to obtain something like that : But the only examples i can find are lists like that : android - listview fastscroll with alphabet like on iPhone contacts activity Obviously, I don't want a list like the contacts which displays the…
Sephy
  • 50,022
  • 30
  • 123
  • 131
48
votes
4 answers

Simple way to sort strings in the (case sensitive) alphabetical order

I need to sort list of strings in the alphabetical order: List list = new ArrayList(); list.add("development"); list.add("Development"); list.add("aa"); list.add("AA"); list.add("Aa"); A common way to do it is to use…
Michael
  • 10,063
  • 18
  • 65
  • 104
39
votes
4 answers

Eclipse organize methods in alphabetical order

I have a large class that contains about 30 methods. Is it possible to automatically sort them in alphabetical order in eclipse? I was hoping to do this so they would be easier to find when java browsing or looking at the class outline window.
33
votes
7 answers

Convert numbers into corresponding letter using Python

I was wondering if it is possible to convert numbers into their corresponding alphabetical value. So 1 -> a 2 -> b I was planning to make a program which lists all the alphabetical combinations possible for a length specified by a user. See I know…
user3556962
  • 353
  • 2
  • 4
  • 4
30
votes
9 answers

SQL Listing all column names alphabetically

I know that SELECT * FROM Table will list all columns in the table, but I am interested in listing the columns in alphabetical order. Say, I have three columns, "name", "age" and "sex". I want the columns organized in the format |age| |name|…
Shamim Hafiz - MSFT
  • 21,454
  • 43
  • 116
  • 176
29
votes
5 answers

php select from mysql where title begins with A (and A alone)

I'm sure this is super easy, but can't seem to figure it out.. I need to select all titles from my database where the title starts with A, or B, or C etc. Here's what I've tried so far: SELECT * FROM weblinks WHERE catid = 4 AND title LIKE 'A' but…
SoulieBaby
  • 5,405
  • 25
  • 95
  • 145
28
votes
16 answers

Generating an alphabetic sequence in Java

I'm looking for a way of generating an alphabetic sequence: A, B, C, ..., Z, AA, AB, AC, ..., ZZ. Can anyone suggest a convenient way of doing this. What data structures can I make use of? I'd like methods which get the next code in the sequence…
mip
  • 1,886
  • 8
  • 26
  • 32
23
votes
8 answers

How to make a continuous alphabetic list python (from a-z then from aa, ab, ac etc)

I would like to make a alphabetical list for an application similar to an excel worksheet. A user would input number of cells and I would like to generate list. For example a user needs 54 cells. Then I would…
Seb
  • 3,655
  • 3
  • 17
  • 17
23
votes
2 answers

if string is alphabetically greater than other string in objective

I'm trying to use an if statement to work out which of 2 strings comes first alphabetically. Like with numbers and greater and less than: if (1 < 2) { just with strings: if(@"ahello" < @"bhello") { Or would I have to have a string containing all…
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
23
votes
1 answer

Alphabetize lines of a given range in vim

I have several lines that I want to alphabetize. For example, say I have a bunch of vim set commands in a file: set nowrap set number set expandtab set hlsearch set list How would I alphabetize these 5 lines? The output would look like this: set…
EvergreenTree
  • 1,788
  • 2
  • 16
  • 30
1
2 3
48 49