Click here to Skip to main content
14,328,670 members
   

C#

 
GeneralRe: How to get the Count of webseit visitors using Razor ASP.Core ? Pin
Abdalla Ben Omran27-May-19 0:59
memberAbdalla Ben Omran27-May-19 0:59 
GeneralRe: How to get the Count of webseit visitors using Razor ASP.Core ? Pin
OriginalGriff27-May-19 1:05
protectorOriginalGriff27-May-19 1:05 
GeneralRe: How to get the Count of webseit visitors using Razor ASP.Core ? Pin
Abdalla Ben Omran27-May-19 1:56
memberAbdalla Ben Omran27-May-19 1:56 
GeneralRe: How to get the Count of webseit visitors using Razor ASP.Core ? Pin
Gerry Schmitz27-May-19 7:58
mveGerry Schmitz27-May-19 7:58 
AnswerRe: How to get the Count of webseit visitors using Razor ASP.Core ? Pin
#realJSOP27-May-19 7:34
mve#realJSOP27-May-19 7:34 
QuestionHow to replace every different char with another given char Pin
Member 1379031625-May-19 5:49
memberMember 1379031625-May-19 5:49 
AnswerRe: How to replace every different char with another given char Pin
Richard MacCutchan25-May-19 6:04
protectorRichard MacCutchan25-May-19 6:04 
AnswerRe: How to replace every different char with another given char Pin
OriginalGriff25-May-19 6:34
protectorOriginalGriff25-May-19 6:34 
Richard's solution will work fine, but a better solution is to have two "translation arrays":
private const string transA = "abcdefghijklmnopqurstuvwxyz";
private const string transB = "bcdefghijklmnopqurstuvwxyza";
And then index them:
char[] chars = new char[inputString.Length];
for (int i = 0; i < inputString.Length; i++)
    {
    int index = transA.IndexOf(inputString[i]);
    chars[i] = index >= 0 ? transB[index] : inputString[i];
    }
string outputString = new string(chars);
That way, you aren't forced to use a "simple one character shift" on your Caesar Cipher - you can get more creative.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

JokeRe: How to replace every different char with another given char Pin
Eddy Vluggen25-May-19 10:05
mveEddy Vluggen25-May-19 10:05 
AnswerRe: How to replace every different char with another given char Pin
Gerry Schmitz25-May-19 6:59
mveGerry Schmitz25-May-19 6:59 
AnswerRe: How to replace every different char with another given char Pin
BillWoodruff25-May-19 18:43
mveBillWoodruff25-May-19 18:43 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031625-May-19 22:33
memberMember 1379031625-May-19 22:33 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff25-May-19 23:29
mveBillWoodruff25-May-19 23:29 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031626-May-19 0:23
memberMember 1379031626-May-19 0:23 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff26-May-19 0:50
mveBillWoodruff26-May-19 0:50 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031626-May-19 1:52
memberMember 1379031626-May-19 1:52 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff26-May-19 18:57
mveBillWoodruff26-May-19 18:57 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031626-May-19 19:01
memberMember 1379031626-May-19 19:01 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff26-May-19 21:16
mveBillWoodruff26-May-19 21:16 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031627-May-19 0:33
memberMember 1379031627-May-19 0:33 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff27-May-19 0:46
mveBillWoodruff27-May-19 0:46 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031627-May-19 0:56
memberMember 1379031627-May-19 0:56 
GeneralRe: How to replace every different char with another given char Pin
BillWoodruff27-May-19 2:39
mveBillWoodruff27-May-19 2:39 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031628-May-19 8:29
memberMember 1379031628-May-19 8:29 
GeneralRe: How to replace every different char with another given char Pin
Member 1379031628-May-19 20:19
memberMember 1379031628-May-19 20:19 

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.