How can I do SELECT UNIQUE with LINQ?

I have a list like this: Red Red Brown Yellow Green Green Brown Red Orange I am trying to do a SELECT UNIQUE with LINQ, i.e. I want Red Brown Yellow Green Orange var uniqueColors = from dbo in...

Regular expression for checking if capital letters are found consecutively in a string

I want to know the regexp for the following case: The string should contain only alphabetic letters. It must start with a capital letter followed by small letter. Then it can be small letters or...

How to convert a char from an alphabetical character to a hexadecimal number in Java?

How do I convert a char from an alphabetical character to hexadecimal number in Java? If any one knows any built-in methods in Java that does the job or if you have your own method, could you...

Sort nodes of a XML file

Sorting is giving me a hard time. I need help with an small example, so that I can understand xsl:sort better. My xml data looks as followed: <NewTerms> <newTerm>Zebra</newTerm> ...

Comparing strings by their alphabetical order

String s1 = "Project"; String s2 = "Sunject"; I want to compare the two above string by their alphabetic order (which in this case "Project" then "Sunject" as "P" comes before "S"). Does anyone...

Client ID: Unique specified identifier

I am working on a small project that capture customer details, Using C Sharp in Visual Studio 2010 and a SQL database. Now i need to make my customer ID to be stored as follow, The ID needs to...

What character to use to put an item at the end of an alphabetic list?

I often prepend '_____' to the item I want in first position. Is there some sort of magical character I could use to put an item at the end of the list? Something more elegant than...

Sort an NSMutableArray of custom objects Alphabetically

I have an NSMutableArray of custom objects. The custom object (Tag Class) has an two properties defined as so: @interface Tag : NSObject @property (strong, nonatomic) NSString *tid; @property...

Get properties in order of declaration using reflection

I need to get all the properties using reflection in the order in which they are declared in the class. According to MSDN the order can not be guaranteed when using GetProperties() The...

Sorting HTML table with JavaScript

I'm after a table sorting solution (in JavaScript) but I can't seem to find a suitable one yet. I just need it to sort each column alphabetically. It doesn't need to ignore any code or any numbers...

Sort a String array, whose strings represent int

I have String[] array like {"3","2","4","10","11","6","5","8","9","7"} I want to sort it in numerical order, not in alphabetical order. If I use Arrays.sort(myarray); I...

Groovy resolves ambiguous methods alphabetically by parameter class name

Groovy will resolve ambiguous method calls by choosing the method with a parameter type that is alphabetically first. In the following example the method that takes a parameter of type "A" will be...

Validation to allow space character only when followed by an alphabet

I am trying to validate the textbox which has to allow space character only when followed by any alphabetic character. My code fails when only a space character is inserted. What is the mistake in...

reading a hand of cards and adding points

I am a newbie and i am having some problems with structuring a solution to my new assignment. I cant figure out how add the points based on the number of cards in a suit which is the...

Sorting a nested OrderedDict by key, recursively

Say orig is an OrderedDict which contains normal string:string key value pairs, but sometimes the value could be another, nested OrderedDict. I want to sort orig by key, alphabetically...

How to sort list of tuples by several keys

I am doing an exercise on Python and lists with one problem: I have a list of tuples sorted by second key: [('f', 3), ('a', 3), ('d', 3), ('b', 2), ('c', 2)] And I need sort it: Second value by...

Sort (sorting) order of files in notebook list

How can I change the sort order of files in the notebook list? I would like it to be alphabetical for all file types and not case sensitive. Directories can appear before files or within the...

Python prettytable Sort by Multiple Columns

I'm using PrettyTable to print data to the terminal in a nice table format. It's pretty easy to print it ordered by a single column. from prettytable import PrettyTable table =...

How to check if a string only contains alphabetic characters in Go?

I am trying to check the username whether is only containing alphabetic characters. What is the idiomatic way to check it in Go?

How to order feature files in Cucumber test suite?

Currently, I have found that cucumber test suite runs the feature files alphabetically. Please let me know if there is any option/configuration that I might be missing. Thanks.

How do i sort Realm Results list alphabetically in android?

I have one realm list and i want to sort the list alphabetically. Collections.sort(contacts, new java.util.Comparator<Contacts>() { @Override public int compare(Contacts l1,...

Trying to create a table from a text file in Python 3.6

I am just starting out learning Python and for my project we need to take a file and create a table listing the team name in one column and wins in another column with header and have in...

sort array by length and then alphabetically

I'm trying to make a way to sort words first by length, then alphabetically. // from $array = ["dog", "cat", "mouse", "elephant", "apple"]; // to $array = ["cat", "dog", "apple", "mouse",...

How to change Intellisense priority in Visual Studio Code

How do I change the priority of the abbreviation recommendations inside Visual Studio Code? The file in question is a .scss file and I have tried with and without the Sass extension in Code...

Sort string array first on length then alphabetically in Python 3

How to sort an array in python firstly by the length of the words (longest to shortest), and then alphabetically? Here is what I mean: I have this list: WordsArray = ["Lorem", "ipsum", "dolor",...

Sort List by alphabetical order

I'm trying to sort a list by alphabetical order and tried porting something i had in javascript to flutter. But it gives me an exception on String that it does not have the instance method '<'. I...

Merge arrays and keep ordering

NOTE The question has been edited following the good advise from @Kaddath to highlight the fact that the ordering doesn't have to be alphabetical but depending on the position of items inside the...

Validating empty space in class validator

I want to validate Address field, it may contains numbers or strings, but it should not accept continioues empty spaces @IsAlphaNUmereic() Address: string; i want that, Address can be numeric...

SwiftUI - How to create TextField that only accepts numbers

I'm new to SwiftUI and iOS, and I'm trying to create an input field that will only accept numbers. TextField("Total number of people", text: $numOfPeople) The TextField currently allows...

How to sort a Set<String> alphabetically in Dart/Flutter?

I know there is the List<string>, but I need to use a Set<string>. Is there a way to to sort it alphabetically? Set reasons = { 'Peter', 'John', 'James', 'Luke', }