C# How can i swap the first with the last character from a string -



C# How can i swap the first with the last character from a string -

id create method: public static string frontback(string str) {}

this method should exchange first char lastly char.

for illustration : console.writeline(frontback("code"));

so in case i'd replace char "c" "e" , result should eodc.

public static string frontback(string str) { int len = str.length; homecoming str[len-1] + str.substring(1,len-2) + str[0]; }

c# string

Comments

Popular posts from this blog

python - How to add an model instance to a django queryset? -

Using Android Volley to post an array to PHP -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -