原文网址:http://wfly2004.blog.163.com/blog/static/1176427201032692927349/Java中字符串中子串的查找共有四种方法,如下:1、int indexOf(String str) :返回第一次出现的指定子字符串在此字符串中的索引。2、int ...
分类:
编程语言 时间:
2015-04-26 22:37:31
阅读次数:
142
1、第一种方法 package five; public class Fivetwozero { public static void main(String[] args){ //定义两个字符串 String str="hello world"; String str1="Hello j...
分类:
其他好文 时间:
2015-04-26 22:24:40
阅读次数:
135
我们在编码的时候经常会用到findviewById,不厌其烦,我之前介绍过一个很取巧的方法,挺好用的,这里再贴一下:public class KaleBaseActivity extends Activity { private String TAG = getClass().getSimpl...
分类:
其他好文 时间:
2015-04-26 19:43:18
阅读次数:
786
--计算字符串string中char的个数--better versionlocal function count_char(string, char) local index = 0 local count = 0 while ture do index = string.find(s...
分类:
其他好文 时间:
2015-04-26 18:09:20
阅读次数:
125
1.string相关函数我分别尝试了compare substring split函数,如上图示。compare函数会比较输入是两个string,然后返回一个int值显示结果。substring可以读取string里的一部分,(开始索引,索引个数)。split可以对string按照给出的条件分割。2...
Remove Duplicates from Sorted ArrayTotal Accepted:57887Total Submissions:183534My SubmissionsQuestionSolutionGiven a sorted array, remove the duplicat...
分类:
其他好文 时间:
2015-04-26 17:59:54
阅读次数:
122
#一个最简单的事件总线实现 [MicroBus](https://github.com/konmik/MicroBus) ##使用 注册 class Receiver implements MicroBus.BusEventReceiver { public onCreate() { bus.register(this, String.class); } pu...
分类:
编程语言 时间:
2015-04-26 16:55:20
阅读次数:
150
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-04-26 16:51:58
阅读次数:
142
matlab代码如下:close all;
clear all;
clc;
% key=1; %key 用来设置需要压缩的比例
%读入原始图像original string,os 原始图像字符串
[filename pathname]=uigetfile('*.bmp;*.jpg;*.tif', '原图像.jpg');
os=[pathname filename];
o=imread(os);
%读...
分类:
其他好文 时间:
2015-04-26 16:48:18
阅读次数:
174