引用头文件:#import "JSONKit.h"
// 字典转成json,解决全角问题
-(NSString *) toJson:(NSMutableDictionary*)dic
{
// 转换成json
NSString * string =[dic JSONString];
NSUInteger length = [string length];...
分类:
移动开发 时间:
2015-05-08 11:03:14
阅读次数:
141
有些时候,js中日期显示出来是 yyyy/MM/dd 这种格式,但是我需要yyyy-MM-dd格式的
简单粗暴的直接replace总是不太好,或者通过Date对象的相关方法拼接起来,也还是有些粗暴
要是可以格式化就好了,
在网上收集了一些资料,经过修改调试,完成可用,OK,以下的代码:
(1)首先需要扩展日期Data的格式化方法
//扩展日期格式化方法
Date.prototype...
分类:
Web程序 时间:
2015-05-08 11:00:12
阅读次数:
145
【题目】
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are ...
分类:
其他好文 时间:
2015-05-08 10:55:44
阅读次数:
95
@RequestParam注解用于在控制器中绑定请求参数到方法参数.用法如下:@RequestMappingpublic void advancedSearch(@RequestParam("queryStr") String queryStr,@RequestParam("showFlag") S...
分类:
其他好文 时间:
2015-05-08 10:50:49
阅读次数:
244
文件的创建以及文件信息的获取:
首先,创建一个FileutilDemo.java类又来保存文件名字:
import java.io.File;
public class FileUtilDemo {
public static final String FILE_NAME="myFile.text";
public static final String FOLDER_NAME="Ne...
分类:
其他好文 时间:
2015-05-08 09:40:14
阅读次数:
122
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like
this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I ...
分类:
其他好文 时间:
2015-05-08 09:36:17
阅读次数:
136
问题描述:
写一个函数,用于比较两个字符串的比较(string_compare).
程序分析:
(1)主要思想:传入两个字符串后,比较这两个字符串中的每个元素,如果第一次比较就不相等,就不要让它进入到下面的比较中。这样一来,将它返回一个相减的值(即:两数组中开始不相等的那两个元素相减,返回值(int类型),是ASCII码值相减)。进入比较的过程中时,相等就返回0;其他情况都返回那个相减的值。...
分类:
编程语言 时间:
2015-05-08 09:35:46
阅读次数:
117
【题目】
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below....
分类:
其他好文 时间:
2015-05-08 09:29:30
阅读次数:
121
cc150 Question 11.2 Sort array of string that anagrams next to each other.(leetcode 也有类似题目)Solution 1: 借助Arrays.sort, 需要重写comparator。 1 public sta...
分类:
其他好文 时间:
2015-05-08 06:59:04
阅读次数:
152
package sizeys;import java.text.DecimalFormat;import java.util.Scanner;public class H { public static void main(String[] args) { Scanner sca...
分类:
其他好文 时间:
2015-05-08 01:36:50
阅读次数:
143