Click here to Skip to main content
15,845,469 members
Home / Discussions / C#
   

C#

 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
Eddy Vluggen17-Feb-15 13:00
professionalEddy Vluggen17-Feb-15 13:00 
AnswerRe: Visual studio 2010 C# identity without hyphen Pin
#realJSOP18-Feb-15 7:24
mve#realJSOP18-Feb-15 7:24 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
sdfsdfsdfewrew3feff20-Feb-15 7:05
sdfsdfsdfewrew3feff20-Feb-15 7:05 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
#realJSOP21-Feb-15 3:25
mve#realJSOP21-Feb-15 3:25 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
sdfsdfsdfewrew3feff23-Feb-15 3:09
sdfsdfsdfewrew3feff23-Feb-15 3:09 
GeneralRe: Visual studio 2010 C# identity without hyphen Pin
sdfsdfsdfewrew3feff1-Mar-15 6:10
sdfsdfsdfewrew3feff1-Mar-15 6:10 
QuestionConverting Alphabet to corresponding number Pin
Tetra104416-Feb-15 6:27
Tetra104416-Feb-15 6:27 
AnswerRe: Converting Alphabet to corresponding number Pin
Rob Philpott16-Feb-15 6:33
Rob Philpott16-Feb-15 6:33 
Well on the assumption that your string is ASCII encoded, and with the knowledge that 'A' = 65 its simply a case of casting the character to an integer and taking off 64.

You could try something like this using linq:
var input= "ABC";
var output = input.Select(x => ((int)x)-64).ToArray();


or, more clearly:
int[] output = new int[input.Length];
for (int i = 0; i < input.Length; i++) output[i] = ((int)input[i]) - 64;

Regards,
Rob Philpott.

GeneralRe: Converting Alphabet to corresponding number Pin
Tetra104416-Feb-15 7:10
Tetra104416-Feb-15 7:10 
SuggestionRe: Converting Alphabet to corresponding number Pin
Richard Deeming16-Feb-15 9:29
mveRichard Deeming16-Feb-15 9:29 
GeneralRe: Converting Alphabet to corresponding number Pin
Rob Philpott16-Feb-15 10:28
Rob Philpott16-Feb-15 10:28 
GeneralRe: Converting Alphabet to corresponding number Pin
Wastedtalent19-Feb-15 5:55
professionalWastedtalent19-Feb-15 5:55 
AnswerRe: Converting Alphabet to corresponding number Pin
PIEBALDconsult16-Feb-15 6:47
mvePIEBALDconsult16-Feb-15 6:47 
GeneralRe: Converting Alphabet to corresponding number Pin
Tetra104416-Feb-15 7:12
Tetra104416-Feb-15 7:12 
AnswerRe: Converting Alphabet to corresponding number Pin
BillWoodruff16-Feb-15 13:59
professionalBillWoodruff16-Feb-15 13:59 
GeneralRe: Converting Alphabet to corresponding number Pin
Rob Philpott17-Feb-15 0:21
Rob Philpott17-Feb-15 0:21 
QuestionWhy is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 2:09
robinsc16-Feb-15 2:09 
AnswerRe: Why is Array.Sort() slower if I use my own comparer? Pin
Rob Philpott16-Feb-15 3:06
Rob Philpott16-Feb-15 3:06 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 3:20
robinsc16-Feb-15 3:20 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
Rob Philpott16-Feb-15 3:26
Rob Philpott16-Feb-15 3:26 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 3:35
robinsc16-Feb-15 3:35 
SuggestionRe: Why is Array.Sort() slower if I use my own comparer? Pin
Richard Deeming16-Feb-15 9:20
mveRichard Deeming16-Feb-15 9:20 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
Rob Philpott16-Feb-15 9:22
Rob Philpott16-Feb-15 9:22 
GeneralRe: Why is Array.Sort() slower if I use my own comparer? Pin
robinsc16-Feb-15 22:57
robinsc16-Feb-15 22:57 
AnswerRe: Why is Array.Sort() slower if I use my own comparer? Pin
Dave Kreskowiak16-Feb-15 3:56
mveDave Kreskowiak16-Feb-15 3:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.