d04b9cac4dfb001c1573b62be8af1246

来自「Svm based face detector code」· 代码 · 共 28 行

TXT
28
字号
package com.sans.ninemen.core;

public class Utility {
	public static int countChar(String position,char x) {
		int length = position.length();
		char[] charArray = new char[23];
		charArray = position.toCharArray();
		int count =0;
		for(int i=0;i<23;i++) {
			if(charArray[i]==x) {
				count++;
			}
		}
		return count;
	}
	
	public static String reverseColors(String position) {
		//System.out.println("initial="+position);
		String reverse = position;
		String temp1=reverse.replaceAll("W", "C");
		String temp2=temp1.replaceAll("B", "W");
		String temp3=temp2.replaceAll("C", "B");
		//System.out.println("reverse="+temp3);
		return temp3;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?