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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -