码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
java的clone
java的浅克隆,十分简单。但是只会克隆基本的数据类型,当涉及到引用类型时就不好用了。 public?class?Employee?implements?Cloneable?{ ?private?String?name; ?private?String?gender; ?public?S...
分类:编程语言   时间:2014-12-15 22:13:20    阅读次数:251
python-发邮件脚本
折腾nagios发邮件好几天,终于完成,我的系统环境是ubuntu12.04,安装postfix服务,先贴上脚本,如下:#!/usr/bin/envpython#-*-coding:utf-8-*-‘‘‘from:改成你的邮箱地址‘‘‘importdatetime,smtplib,string,sysfromemail.HeaderimportHeaderfromemail.MIMETextimportMIMETextfr..
分类:编程语言   时间:2014-12-15 22:00:35    阅读次数:281
[LeetCode]Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ["aa","...
分类:其他好文   时间:2014-12-15 21:52:33    阅读次数:145
[LeetCode]Palindrome Partitioning II
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...
分类:其他好文   时间:2014-12-15 21:50:08    阅读次数:172
Java 判断中文字符
Java判断一个字符串中是否有中文字符有两种方法,但是原理都一样,就是通过Unicode编码来判断,因为中文在Unicode中的编码区间为:0x4e00--0x9fa5第一种: String chineseStr = "中华人民公社abc"; char[] charArray = chinese.....
分类:编程语言   时间:2014-12-15 21:39:03    阅读次数:190
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. #include #include #include char *longestCommonPrefix(char *strs[],int n) { int i,j,k; char *res=(...
分类:其他好文   时间:2014-12-15 20:24:22    阅读次数:174
泛型使用中,解决类型转换问题
遇到的问题是这样,系统中有一个字符类型的字段来存储一些通用的系统配置,虽然存储的形式是字符串,但是实际在系统中的使用类型则可能是string, bool, int, decimal.这个时候就想写一个通用的方法来获取各种不同类型的返回值,当然这个时候想到的就是使用泛型。那么这个方法的定义大概就是这样...
分类:其他好文   时间:2014-12-15 20:18:14    阅读次数:171
wp8.1 Study11:APP里文件读写和使用XML和Json序列化
一、文件读写1、基本操作(使用FileIO API) 这个方法在上一个stduy已经学过,那么贴出来复习下,代码如下:private async void writeTextToLocalStorageFile(string filename, string text) { ...
分类:移动开发   时间:2014-12-15 20:17:21    阅读次数:244
Matcher.appendReplacement(StringBuffer sb, String replacement)解析
Pattern p = Pattern.compile("cat");Matcher m = p.matcher("one cat two cats in the yard");StringBuffer sb = new StringBuffer();while (m.find()) { m.app...
分类:移动开发   时间:2014-12-15 20:14:42    阅读次数:187
获取当前ip
public?class?IpUtils{ ??/** ??*?获取ip地址 ??*?@param?request ??*?@return ??*/ ?public?static?String?getIpAddr(HttpServletRequest?request)?{? ?????String?ip?=?...
分类:其他好文   时间:2014-12-15 19:12:34    阅读次数:103
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!