0
String move?
Hey peole, Could anybody help me with this code? I want to code a program that would obtain a string from user and send it to method. For example, i give the string "12345" then it will return the value like"1524334251" inside the method and finally it will return it to the main method. There is a specific alogroithm for that kind of return but i don't really know how can i code this!
1 Odpowiedź
+ 1
These will be the steps.
1. take users input.
2. break the input string to an array of characters (google c# .split("") method.
3. take another array that's the reverse of input characters array
4. take an empty variable result.
5. for i in 0..array.length, append input[i] and result[i] to result.
6. print output.
I've an example here done in ruby, you can easily modify to c#.
the logic is the same.
https://code.sololearn.com/cXWdo7bLqgml/#rb