日期:2014-05-18 浏览次数:20516 次
string str = " sdf sdf sdf " str = Regex.Replace(Regex.Replace(a,@"(^\s+|\s+$)",""),@"\s+"," ");
------解决方案--------------------
string str = " sdf sdf sdf " str = Regex.Replace(str.Trim(),@"\s+"," ");
------解决方案--------------------
第一题:
a.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="a.aspx.cs" Inherits="Web.a" Trace="true"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>无标题页</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" Text="跳转到b.aspx" OnClientClick="return window.confirm('要跳转到b.aspx吗?')" onclick="Button1_Click" /> </div> </form> </body> </html>
------解决方案--------------------
前两提都有人答了,我也学习了,第三题我的答案:
应该是将x,y交换值,但是结果应该是:a.PA=2,b.PA=2