码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
c#中的类型转换
Parse类型转换Parse()函数int、double都能调用Parse()函数,Parse(string str);如果转换成功就成功,失败就会抛出一个异常;TryParse()函数相应地有一个TryParse函数,bool TryParse(string str,out int a);这里的out参数相当于c++中的&,引用(区别是c#的这个方法里必须对a赋值,且所有分支都要赋值)。如果能够...
分类:Windows程序   时间:2015-05-12 21:03:49    阅读次数:145
String.getBytes()方法中的中文编码问题(转)
String的getBytes()方法是得到一个系统默认的编码格式的字节数组getBytes("utf-8")得到一个UTF-8格式的字节数组把String转换成bytes,各种编码转换成的bytes不同,比如UTF-8每个汉字转成3bytes,而GBK转成2bytes,所以要说明编码方式,否则用....
分类:其他好文   时间:2015-05-12 20:48:32    阅读次数:117
【Longest Valid Parentheses】cpp
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the long...
分类:其他好文   时间:2015-05-12 20:40:49    阅读次数:88
由于期中考好久没A了
#include "stdio.h"#include "string.h"int main(){char str[1000];int n,m,i,t,j;while(scanf("%d\n",&m)!=EOF){for(j=0;j='0'&&str[i]int main(){ int n,i,k=0...
分类:其他好文   时间:2015-05-12 20:36:59    阅读次数:95
4. C# -- IF, ELSE IF, ELSE
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { staticvoidMain(string[]args) { intvar=1; if(var==1) { Console.WriteLine("var=1"); } elseif(var==2) {..
分类:Windows程序   时间:2015-05-12 19:21:03    阅读次数:159
5. C# -- 显式/隐式类型转换,溢出检查
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { staticvoidMain(string[]args) { ushortdestinationVar; ushortdestinationVar2; charSourceVar=‘a‘; desti..
分类:Windows程序   时间:2015-05-12 19:20:22    阅读次数:185
8. C# -- 一维数组,二维数组,锯齿数组
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { staticvoidMain(string[]args) { //声明一维数组,并输出 Console.WriteLine("ouputarray."); string[]fri..
分类:编程语言   时间:2015-05-12 19:12:40    阅读次数:114
9. C#-- 字符串的一些操作
usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Threading.Tasks; namespaceConsoleApplication1 { classProgram { staticvoidMain(string[]args) { //string类型变量可以看作只读数组 stringmyString="AString"; charmyCha..
分类:Windows程序   时间:2015-05-12 19:04:46    阅读次数:163
Android开发实用工具类(小方法)
1,邮箱地址只展示部分,只展示@前面部分的第1个及最后一个字符,其它的用*代替: public static String spliteEmail(String email) {/**传入邮箱地址*/ String newEmail = email.split("@")[0];/**获取到邮箱@前面部分*/ String[] mails = new String[newEmail...
分类:移动开发   时间:2015-05-12 18:53:07    阅读次数:138
ASP.NET同页面内【用户控件与父页面】以及【用户控件与用户控件】之间方法调用
在用户控件中,获取父页面的方法1:方法没有参数(userInfor())string userInfor = Convert.ToString(this.Page.GetType().GetMethod("userInfor").Invoke(this.Page, null)); //获取到的值是o...
分类:Web程序   时间:2015-05-12 18:45:04    阅读次数:144
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!