码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
简单的冒泡排序算法(java)
package lianxi;public class BubbleSort{ public static void main(String[] args) { int[] array = {12,23,3,5,65,67,34,23,5,7,789,435,2,4}; ...
分类:编程语言   时间:2015-04-21 09:33:31    阅读次数:121
C#正则表达式获取网址的域名(IP)
代码如下:string p = @"(http|https)://(?[^(:|/]*)";Regex reg = new Regex(p, RegexOptions.IgnoreCase);Match m = reg.Match(HostUrl);Result=m.Groups["domain"]...
分类:Windows程序   时间:2015-04-21 09:32:38    阅读次数:885
PHP:计算文件或数组中单词出现频率
一:如果是小文件,可以一次性读入到数组中,使用方便的数组计数函数进行词频统计(假设文件中内容都是空格隔开的单词): <?php $str = file_get_contents("/path/to/file.txt"); //get string from file pre...
分类:编程语言   时间:2015-04-21 09:23:40    阅读次数:108
天题系列:Substring with Concatenation of All Words
滑动窗口,但是很繁琐 public class Solution { public ArrayList findSubstring(String S, String[] L) { //http://www.cnblogs.com/springfor/p/3872516.html ...
分类:其他好文   时间:2015-04-21 08:20:56    阅读次数:230
单词计数WordCountApp.class
public class WordCountApp { // 可以指定目录,目录下如果有二级目录的话,是不会执行的,只会执行一级目录. private static final String INPUT_PATH = "hdfs://hadoop1:9000/abd";// 输入路径 ...
分类:移动开发   时间:2015-04-21 01:42:11    阅读次数:199
JavaScript内置对象,Date String Array等,以及这些对象操作。
练习题:某班的成绩出来了,现在老师要把班级的成绩打印出来。效果图:2014年5月9日 星期六--班级总分为: 班级平均分为:格式要求:1、显示打印的日期。 格式为类似“2014年03月21日 星期三” 的当前的时间。2、计算出该班级的平均分(保留整数)。同学成绩数据如下:"小明:87; 小花:...
分类:编程语言   时间:2015-04-21 01:40:47    阅读次数:193
一个for循环打印乘法九九表
public static void main(String[] args) { for(int i=1, count=1; i<=9;count++){ System.out.print(count*i + " "); if(count==i){ Syste...
分类:其他好文   时间:2015-04-21 01:34:13    阅读次数:107
C# string的一些函数
创建string: string (char[]) 使用指定的字符串数组构建一个新的string对象 Copy(string) 使用指定的string构建一个新的string对象 比较函数: Compare(a,b) 和a.CompareTo(b) 相等返回0,大于返回正数,小于返回负数; ...
分类:Windows程序   时间:2015-04-21 01:32:02    阅读次数:167
字符串乱码处理
//处理Request request.setCharacterEncoding("utf-8"); String?name?=?request.getParameter("username"); String?newName?=new?String(name.getBytes("iso-8859-1"),"utf-8"); System.out.println("您输入...
分类:其他好文   时间:2015-04-21 00:31:57    阅读次数:117
JavaIO 将数据写入到文件中去
package com.Practice_FileWriter;import java.io.FileWriter;import java.io.IOException;public class JustPractice { public static void main(String[] a...
分类:编程语言   时间:2015-04-21 00:24:42    阅读次数:198
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!