码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
使用Java 8 API,根据传递的分隔符,连接list中所有的元素
public class MethodReferenceDemo1 { @FunctionalInterface interface StringListFormatter { String format(String delimiter, List list); } public static v...
分类:编程语言   时间:2015-01-27 17:54:22    阅读次数:228
提取c#代码文件中的方法块
此方法是取C#文件里面的方法块,并删除缩进符,感觉写得还是比较容易懂的,所以收藏下,以便将来用到. private static string GetCodeBlock(string allCode, string blockName) { in...
分类:Windows程序   时间:2015-01-27 17:39:48    阅读次数:196
leetcode-----------Longest Palindromic Substring
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 下面是英文,祝你好运 ...
分类:其他好文   时间:2015-01-27 16:35:09    阅读次数:363
python基础教程笔记-项目1-即时标记-Day4
今天主要看下re.sub函数和Handler类的sub函数 先看下re.sub函数 re.sub共有5个参数,不过一般写前三个就好了,即pattern,repl和string pattern表示正则中的模式字符串,repl可以是字符串,也可以是函数。string为要进行替换的字符串 先看一段代码: import re def Num2A(match): return 'A' a...
分类:编程语言   时间:2015-01-27 16:28:12    阅读次数:219
[Leetcode] 22- Generate Parentheses
原题链接:https://oj.leetcode.com/problemset/algorithms/ 这里用递归的方法实现。递归函数签名为void generate(int left, int right, int n, string prev) 1. left,right分别为当前左右括号的个数,prev缓存之前的临时结果 2. left小于n的时候,可以一直加入左括号 3. ...
分类:其他好文   时间:2015-01-27 16:28:01    阅读次数:120
leetcode------------ZigZag Conversion
题目: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...
分类:其他好文   时间:2015-01-27 16:26:55    阅读次数:172
[LeetCode]Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great / gr ...
分类:其他好文   时间:2015-01-27 16:25:51    阅读次数:169
Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. #include #includ...
分类:其他好文   时间:2015-01-27 15:02:38    阅读次数:164
图片的读取和保存操作
public static void LoadPicFromStream(string url) { string content = string.Empty; HttpWebRequest request = (HttpWebR...
分类:其他好文   时间:2015-01-27 14:49:25    阅读次数:169
控制台输入一个简单表达式(+-*/)计算结果
1,? import java.util.Scanner /** * Author: bruce * Date: 2015-01-24 */ object ConsoleScanner { def main(args: Array[String]) { println("Please enter a phase: "); val scan = new Scanner(...
分类:其他好文   时间:2015-01-27 13:38:04    阅读次数:153
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!