Description
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponenti...
分类:
其他好文 时间:
2014-09-13 09:23:34
阅读次数:
197
what are the rules for how == converts types?关于"=="的比较规则:1. Comparing numbers and strings will always convert the strings to numbers.number类型与string类型...
分类:
Web程序 时间:
2014-09-13 00:38:34
阅读次数:
369
关于Android应用实现多语言切换,有好几种办法,网上也搜到很多资料,这里有个简单有效的办法。步骤如下:在资源文件中新建一个文件夹values-en,在里面新建一个strings.xml,把默认values文件夹中的strings.xml中的内容拷贝一份到values-en中的strings.xml,再把该文件夹中的..
分类:
移动开发 时间:
2014-09-12 19:22:24
阅读次数:
247
Pay Close Attention - String Handling
I need to make a detour for a few moments, and discuss how to handle strings in COM code. If you are familiar wi...
分类:
其他好文 时间:
2014-09-11 19:15:22
阅读次数:
455
1.不可变StringString对象是不可变的,String类中每一个看起来会修改String值的方法,实际上都是创建了一个全新的String对象,例如:publicclassImmutable{
publicstaticStringupcase(Strings){
returns.toUpperCase();
}
publicstaticvoidmain(String[]args){
Stringstr1="Str..
分类:
编程语言 时间:
2014-09-10 02:47:40
阅读次数:
256
题意:给你一个字符串,问你最多是由多少段相同的字串构成的解题思路:求next指针的思路,我们匹配到 str[len],可以知道,len - str[len] 是他的循环节,再判断能不能整除就行了。解题代码: 1 // File Name: 2406.cpp 2 // Author: darkdrea...
分类:
其他好文 时间:
2014-09-09 22:48:49
阅读次数:
282
一、解决函数返回指针的几种方法 1. 返回一个指向字符串常量的指针。 例子:char* func(){ rturn "Only work for simple strings";} 优点:简单 缺点:如果你需要计算字符串的内容,这种方法就无能为力了。如果以后需要修改返回的字符串,你也会...
分类:
其他好文 时间:
2014-09-09 18:09:59
阅读次数:
188
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".字符串相加,不难个人思路:1,尾部对齐,然后逐位相加,flag记为进位代码: 1 #inclu...
分类:
其他好文 时间:
2014-09-09 15:26:58
阅读次数:
213
Longest Common Prefix
Total Accepted: 17298 Total
Submissions: 63704My Submissions
Write a function to find the longest common prefix string amongst an array of strings.
题意...
分类:
其他好文 时间:
2014-09-09 13:16:38
阅读次数:
135
Write a function to find the longest common prefix string amongst an array of strings.思路:依次比较即可。 1 class Solution { 2 public: 3 string longestComm...
分类:
其他好文 时间:
2014-09-07 14:46:45
阅读次数:
150