substr(string,start,length)
substr(string,start,length)
string
必需。规定要返回其中一部分的字符串。
start
必需。规定在字符串的何处开始。
正数 - 在字符串的指定位置开始
负数 - 在从字符串结尾的指定位置开始
0 - 在字符串中的第一个字符处开始
...
分类:
其他好文 时间:
2015-03-03 09:56:54
阅读次数:
118
Enumeration e=FileSystemRegistry.listRoots(); //获取文件路径
String root = (String) e.nextElement();
String url="file:///"+root+filename;
FileConnection conn=null;
try{
...
分类:
其他好文 时间:
2015-03-03 09:53:19
阅读次数:
823
Go语言函数中有三个点...表示为可变参数,可以接受任意个数的参数。示例代码:package main import "fmt" func Greeting(prefix string, who ...string) {fmt.Println(prefix)//接收到who是一个数组,可以用for遍...
分类:
编程语言 时间:
2015-03-03 09:49:04
阅读次数:
161
1,线程的命名及取得classMyThreadimplementsRunnable{@Overridepublicvoidrun(){System.out.println(Thread.currentThread().getName());//线程命名的取得}}publicclassTestDemo{publicstaticvoidmain(String[]args){MyThreadmt=newMyThread();newThread(mt,"线程A").start();..
分类:
编程语言 时间:
2015-03-03 06:31:52
阅读次数:
196
final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("...
分类:
移动开发 时间:
2015-03-03 06:23:27
阅读次数:
219
Maximum repetition substringTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7578Accepted: 2281DescriptionThe repetition number of a string is...
分类:
编程语言 时间:
2015-03-03 06:18:08
阅读次数:
327
代码:class Solution {public: bool isValid(string s) { string left = "([{"; string right = ")]}"; stack stk; for(auto c : ...
分类:
其他好文 时间:
2015-03-03 01:04:29
阅读次数:
185
题目Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = “aab”,
Return 1 sinc...
分类:
其他好文 时间:
2015-03-02 23:58:14
阅读次数:
368
代码: 1 class Solution { 2 public: 3 bool isPalindrome(string s) { 4 transform(s.begin(), s.end(), s.begin(), ::tolower); 5 auto lef...
分类:
其他好文 时间:
2015-03-02 23:51:02
阅读次数:
170
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-03-02 23:48:30
阅读次数:
157