Search
Setup for Free
C
C#
•
4y ago
gododo
❔ Help me out please
Im trying tho encrypt words and im pretty much stuck in here
. Im very weak at coding so please forgive me in advance
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,157
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
G
gododo
OP
•
11/16/22, 10:27 PM
G
gododo
OP
•
11/16/22, 10:28 PM
im trying to like change the letter inside the array
T
TheBoxyBear
•
11/16/22, 10:31 PM
What kind of cypher do you want to use
?
G
gododo
OP
•
11/16/22, 10:31 PM
like uh
G
gododo
OP
•
11/16/22, 10:32 PM
a
+ 2
= c
G
gododo
OP
•
11/16/22, 10:32 PM
for example
T
TheBoxyBear
•
11/16/22, 10:32 PM
foreach is read
-only
G
gododo
OP
•
11/16/22, 10:32 PM
oh so its usless
?
T
TheBoxyBear
•
11/16/22, 10:32 PM
Useful if you don
't need to change the values
T
TheBoxyBear
•
11/16/22, 10:33 PM
And just do something with each value that doesn
't involve putting something else in the source collection
G
gododo
OP
•
11/16/22, 10:33 PM
can you explain it rq
T
TheBoxyBear
•
11/16/22, 10:34 PM
foreach relies in IEnumerable which is the backbone of all collection types
, including read
-only types
T
TheBoxyBear
•
11/16/22, 10:34 PM
All foreach knows is it received a character from this unknown collection
, then another character and another
G
gododo
OP
•
11/16/22, 10:34 PM
oh ok
T
TheBoxyBear
•
11/16/22, 10:35 PM
So use for if you need to replace
T
TheBoxyBear
•
11/16/22, 10:35 PM
Then you can use the index
array[i] = newValue;
array[i] = newValue;
G
gododo
OP
•
11/16/22, 10:35 PM
ok
G
gododo
OP
•
11/16/22, 11:07 PM
G
gododo
OP
•
11/16/22, 11:07 PM
how do i make this work
G
gododo
OP
•
11/16/22, 11:08 PM
im trying to like replace the letter of the array alf with a letter of the array lett
G
gododo
im trying to like replace the letter of the array alf with a letter of the array...
G
gododo
OP
•
11/16/22, 11:09 PM
with the help of the key
(ch
)
G
gododo
OP
•
11/16/22, 11:10 PM
so again if theres the letter a the array will move ch places and replace it
G
gododo
OP
•
11/16/22, 11:11 PM
i tried to add the key to the var a but no matter how i convert it
, it will always give me an error
G
gododo
OP
•
11/16/22, 11:12 PM
wait nvm i fixed it for now
G
gododo
OP
•
11/16/22, 11:12 PM
good job me
F
friedice
•
11/16/22, 11:16 PM
Unless I
'm missing something
, this seems unnecessarily complicated
. Can
't you just use a dictionary
?
G
gododo
OP
•
11/16/22, 11:22 PM
thats the issue i think i gotta do it without those
G
gododo
OP
•
11/16/22, 11:23 PM
and also ive never used them anyways
J
Justin
•
11/20/22, 5:17 PM
This is known as a Caesar Shift
. I did find some interesting tutorials online
. No dictionaries necessary
, you can do it with some math and some casting
.
A
Accord
•
11/22/22, 9:05 PM
Was this issue resolved
? If so
, run
/close
/close
otherwise I will mark this as stale and this post will be archived until there is new activity
.
array[i] = newValue;
array[i] = newValue;
Similar Threads
❔ Help me please
C
C# / help
3y ago
❔ Please help me
C
C# / help
3y ago
✅ Help me please
C
C# / help
3y ago
❔ Please Help Me
C
C# / help
3y ago