易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net中substring用法


substring
public String substring(int beginIndex)返回一个新的字符串,它是此字符串的一个子字符串。该子字符串始于指定索引处的字符,一直到此字符串末尾。
例如:
"unhappy".substring(2) returns "happy"
"Harbison".substring(3) returns "bison"
"emptiness".substring(9) returns "" (an empty string)
参数:
beginIndex - 开始处的索引(包括)。
返回:
指定的子字符串。
抛出:
IndexOutOfBoundsException - 如果 beginIndex 为负或大于此 String 对象的长度。
--------------------------------------------------------------------------------
substring
public String substring(int beginIndex,
int endIndex)返回一个新字符串,它是此字符串的一个子字符串。该子字符串从指定的 beginIndex 处开始,一直到索引 endIndex - 1 处的字符。因此,该子字符串的长度为 endIndex-beginIndex。
示例:
"hamburger".substring(4, 8) returns "urge"
"smiles".substring(1, 5) returns "mile"
参数:
beginIndex - 开始处的索引(包括)。
endIndex - 结束处的索引(不包括)。
返回:
指定的子字符串。
抛出:
IndexOutOfBoundsException - 如果 beginIndex 为负,或 endIndex 大于此 String 对象的长度,或 beginIndex 大于 endIndex。
C#中 substring() 有两个重载函数
substring(int a) 用法同上
substring(int a,int b) b参数应该为截取后的字符串长度
上面string得用法不知是针对哪种语法
针对的是c#


相关文档:

ASP.NET服务器控件使用之GridView

1         ASP.NET 服务器控件GridView使用
本教程不介绍服务器端控件的呈现,事件处理,状态等理论知识,只介绍服务器端控件的使用操作,如果您对服务器控件的知识感兴趣,请参阅《ASP.NET服务器控件高级编程》
阅读本文时最好和 文档 《ASP.NET服务器控件使用之Grid ......

Asp.net对文件夹和文件的操作类

using System;
using System.IO;
using System.Web;
namespace SEC
{
/**////
/// 对文件和文件夹的操作类
///
public class FileControl
{
public FileControl()
{
}
/**////
/// 在根目录下创建文件夹
///
///
要创建的文件路径
public void CreateFolder(string FolderPathName)
{ ......

ASP.NET中javascript与c#互相访问

下面要解决的问题如下:
       1.如何在JavaScript访问C#函数?
  2.如何在JavaScript访问C#变量?
  3.如何在C#中访问JavaScript的已有变量?
  4.如何在C#中访问JavaScript函数?
  问题1答案如下:
  javaScript函数中执行C#代码中的函数:
  方法一:
  &nbs ......

ASP.NET常用代码

http://www.chinaz.com/Program/.NET/101U1142006.html
  1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QuerySt ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号