score:1
Accepted answer
static void main(string[] args)
{
string fromstr = "aaa";
string tostr = "cde";
list<string> outputlist = new list<string>();
buildsequence(fromstr, tostr, outputlist);
outputlist.foreach(s => { console.writeline(s); });
console.readline();
}
private static void buildsequence(
string fromstr,
string tostr,
list<string> outputlist,
int index = 0,
string prev = "")
{
ienumerable<string> newstrlist = enumerable
.range(fromstr[index], tostr[index] - fromstr[index] + 1)
.select(c => string.concat(prev, (char)c));
index += 1;
if (index < fromstr.length)
{
foreach (string newstr in newstrlist)
{
buildsequence(fromstr, tostr, outputlist, index, newstr);
}
}
else
{
outputlist.addrange(newstrlist);
}
}
score:1
static int convertfrombase26(string value)
{
const int a = (int)'a';
int result = 0;
foreach (var c in value.toupper())
{
result = (result * 26) + (c - a);
}
return result;
}
Source: stackoverflow.com
Related Query
- Generate range between two strings [AA] -> [CD] or [CCC] -> [DMK]
- Find number of characters mutual between two strings in C#
- Count matching characters between two strings using LINQ
- Date range falling between two dates in a LINQ query
- Finding the difference between two lists of strings
- Get common part between two strings c#
- Generate a C# expression that can concatenate two strings together
- Calculating the Hamming distance between two strings with LINQ
- LINQ query to find common strings between two collections
- LINQ expression to generate a list of days between two dates
- Linq select a range between two strings, such as Col thru Io
- LINQ to SQL: How to setup associations between two tables to populate a list of strings
- Selecting a record where value falls between two strings in LINQ2SQL
- Compare two strings and check the changed value in a contain range
- Remove itens from JSON string based on a comparison between two JSON strings - C#
- how to find date range between two dates in days format using linq c#
- LINQ for two tables where date range between two values
- Get the difference between two lists using LINQ
- How to search between two dates in LINQ to Entity?
- Equality between two enumerables
- Is there a way to get the difference between two sets of objects in c#
- LINQ way to get items between two indexes in a List
- How do I get the differences between two string arrays in C#?
- How to get dates between two dates in C#
- How to get difference between two DataTables
- Linq query between two list objects
- finding difference between two dictionaries
- LINQ to SQL value BETWEEN two double values
- How to calculate number of leap years between two years in C#
- Generate a two dimensional array via LINQ
More Query from same tag
- Using linq with c#
- Query in LINQ with self join
- How to get ID that has a maximum value of Hits by grouping Date by in LINQ
- Load xml file and get the required data with c#
- LINQ Query to mimic IS IN
- LINQ to SQL retrieve multiple columns from single datatable including grouping and sum
- Get Sum of Columns after its group using linq
- Is there any way to write a LINQ Query,for condition like where IDs is in ('ID1','ID2','ID3','ID4'). in(VB.Net)
- Dynamic expression tree with method 'Select'
- Return nested alias for linq expression
- EF6 using custom property in a linq query
- string parsing in linq query and use anonymous type
- Creating arbitrary sized groups from a list of object with lambda/linq in C#
- How to query SQLite for whether a record exists?
- Selecting inner object of the list
- Error Object Reference Not found when Record does not found using Linq to Entity my Query attached
- ASP .Net: Linq check if string array contains string subarray
- Group by Linq . Count of Key field
- Get string from another string array if value matches
- Obtaining incorrect result while performing left outer join using Linq-Why?
- Can I access the skipped "parent" of SelectMany when using dotted syntax in Linq?
- LINQ to SQLite Gives Parser Stack Overflow Error
- Query and Assignment in a Single Step
- Quickest way to learn Linq to Entities
- To concatenate values of a particular column in multiple rows using linq
- Query range of data linq c#
- Using a Type variable in generic collection
- Group By Linq resultset
- LINQ foreach statement to get items not working
- how to Pass Enum int value to controller