String类概念:是一个class类型的类,里面包含许多处理字符串的方法和属性1、length方法。 例:string s = "hello";Console.WriteLine("s的长度为{0}",s.Length);//获取字符串长度,返回int值2、Trim & ToUpper方法。例:s...
public void replaceImageColor(String file, Color srcColor, Color targetColor) throws IOException{ URL http; if(file.trim().startsWith("h...
分类:
编程语言 时间:
2014-12-17 20:25:16
阅读次数:
763
package com.zl.generic;/** * 交换“任意”数组 中两个元素 */public class GenericSwapArray { public static void main(String[] args) { swap(new String[]{"1","2","3"}....
分类:
编程语言 时间:
2014-12-17 20:24:58
阅读次数:
190
public static String getFormatSize(long size) { double kiloByte = size / 1024; if (kiloByte < 1) { return size + "B"; } double megaByte = kiloBy...
分类:
其他好文 时间:
2014-12-17 20:15:52
阅读次数:
267
一个APP新项目为了赶时髦,用上了Asp.net Web API,可能我不是太熟悉,经过我几天潜心研究,web api 确实没啥用,简直属于狗尾续貂之作。新创建一个api controller,大概方法如下public IEnumerable Get();public string Get(int ...
二进制转换成图片: MemoryStream ms = new MemoryStream(bytes);ms.Position = 0;Image img = Image.FromStream(ms);ms.Close();this.pictureBox1.ImageC#中byte[]与string...
该模块实现标准的errno系统符号,每一个对应于一个整数,名称和描述借鉴了linux/include/errno.h。errno.errorcodeDictionary providing a mapping from theerrnovalue to the string name in th.....
分类:
编程语言 时间:
2014-12-17 20:12:41
阅读次数:
267
直接上代码,写了一个选择双色球号码的小东西来显示字体颜色。pipinstallclint将以下代码复制,执行变可看到python在list与string转化,以及彩色文字的输出有多么方便了。#!/usr/bin/python
importrandom
importstring
fromclint.textuiimportcolored
red=[]
blue=[]
red_res=[..
分类:
编程语言 时间:
2014-12-17 18:49:31
阅读次数:
356
32位加密
public static String getMD5(String strSrc) {
StringBuffer buf = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(strSrc.getBytes());
byte b[] = md.diges...
分类:
移动开发 时间:
2014-12-17 18:33:21
阅读次数:
136
#include
#include
#include
using namespace std;
int main()
{
string str("1 2 3 4 5 6 7 8");
char ch[] = "abcdefgh";
string a;
string str_1(ch);
string str_2(str, 2, 5);
string str_3(ch, ...
分类:
编程语言 时间:
2014-12-17 18:29:29
阅读次数:
206