常见的phpcms标签调用1、调用本系统单条数据(调用ID为1的信息,标题长度不超过25个汉字,显示更新日期):"select*fromphpcms_contentwherecontentid=1"/}标题:{str_cut($r[title],50)}URL:{$r[url]}?更新日期:{dat...
分类:
Web程序 时间:
2014-07-09 20:02:19
阅读次数:
193
JAVA中String对象的比较 1.首先介绍三个String对象比较的方法:(1)equals:比较两个String对象的值是否相等。例如: String str1 = "hello quanjizhu";String str2 =str1+"haha";String str3 = new Str...
分类:
其他好文 时间:
2014-07-09 19:32:06
阅读次数:
184
今天在写一个判断字符串是否回文时因为短路求值问题导致了一个bug,记录如下:代码如下bool isPal(char str[],int len){ int begin=0; int end=len-1; bool result=true; cout<<str<<endl; ...
分类:
其他好文 时间:
2014-07-09 19:00:02
阅读次数:
216
public static boolean stringFilter(String str)throws PatternSyntaxException{ String regEx="[`~!@#$%^&*+=|{}':;',\\[\\]./?~!@#¥%……&*——+|{}【】‘;:”“’。,、?\...
分类:
编程语言 时间:
2014-07-09 18:41:23
阅读次数:
242
下面我们来看下appWidget如何通过广播来更新appWidget上的信息,在AppWidget应用(二)的基础上,需要添加一个自定义的消息,并且在AndriodMainfest上注册;代码如下[html]view plaincopy广播消息定义为:private static final Str...
分类:
移动开发 时间:
2014-07-09 18:07:56
阅读次数:
273
Empoyee.javapackage Company;public class Empoyee{ String name = ""; public Empoyee(String name) { this.name = name; } public Str...
分类:
编程语言 时间:
2014-07-09 14:43:27
阅读次数:
144
这道题我错了一次,主要是A跟Z边界没有考虑,其他的就是记得测试时用nextLine,因为字符串可能可能有空格。
import java.util.Scanner;
public class bigLetterCount {
public static int CalcCapital(String str){
int count=0;
for(int i=0;i<str.length()...
分类:
其他好文 时间:
2014-07-09 12:17:19
阅读次数:
279
很简单,逆向输出就好了。
import java.util.Scanner;
public class convertString {
public static void main(String args[]){
Scanner input=new Scanner(System.in);
String s=input.nextLine();
StringBuffer l=new Str...
分类:
其他好文 时间:
2014-07-09 09:11:55
阅读次数:
236
Write a function to find the longest common prefix string amongst an array of strings.
写一个函数找出字符串数组中的最长共现前缀字符串。
思路:共现,即要求数组中的所有元素的前缀中都要出现。所以所得的结果肯定是最短字符串的部分或全部或都不是,总之要以最短字符串为基准与其他字符串比较。
public Str...
分类:
其他好文 时间:
2014-07-08 10:39:49
阅读次数:
203
《TheSwiftProgrammingLanguage》中文翻译及读书笔记,附件中为英文原版教程因21页之前内容和技术关系不大,不做翻译整理,从第21页开始第21页1swift作为一门语言对的新老语言的继承与扩展本页主要内容是简要介绍了一下swift编程语言的定位。拥有自己的数据类型int、float、str..
分类:
编程语言 时间:
2014-07-08 09:44:49
阅读次数:
253