a function that accepts a single parameter as string and returns a string with the characters of ind

Posted by Amperayani under JavaScript on 6/14/2012 | Points: 10 | Views : 1033 | Status : [Member] | Replies : 2
Write a function that accepts a single parameter as string and returns a string with the characters of individual words within the string being reversed. In other words, the order of words remaining intact, simply the characters that form each word should be reversed.

a.d.malleswara prasad


Responses

Posted by: Akiii on: 6/14/2012 [Member] Bronze | Points: 25

Up
0
Down
First take the string and split individual characters in an array. reverse the array with the reverse function. join the string and return the string..


Thanks and Regards
Akiii

Amperayani, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 6/14/2012 [Member] Bronze | Points: 25

Up
0
Down
string str = "dotnetfunda";

char[] letters = str.ToCharArray();

IEnumerable<char> t = letters.Reverse<char>();

foreach (char temp in t)
{
Console.WriteLine(temp);
}
Console.ReadLine();



Try it.....


Thanks and Regards
Akiii

Amperayani, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response