如何使用2个文本框和按钮反转asp.net c#中的字符串 [英] How to reverse the string in asp.net c# using 2 textboxes and button

查看:74
本文介绍了如何使用2个文本框和按钮反转asp.net c#中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,



如何在asp.net c#中反转一个字符串。



我有两个文本框和按钮。



在第一个文本框中,我将输入文本并单击按钮。在第二个文本框中它应该是反向的。



请帮帮我,如何扭转字符串。



谢谢。

Hi frnds,

How to reverse a string in asp.net c#.

I have two textboxes and button.

In First Textbox i will enter the text and clicks on button. and in second textbox it should be reverse.

Please help me, how to reverse the string.

Thanks.

推荐答案

这是你的作业答案..

Here is your answer to your homework..
public static string Reverse( string s )
{
    char[] charArray = s.ToCharArray();
    Array.Reverse( charArray );
    return new string( charArray );
}


这篇关于如何使用2个文本框和按钮反转asp.net c#中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆