Here you can find the source of distance(String seq1, String seq2)
Parameter | Description |
---|---|
seq1 | a parameter |
seq2 | a parameter |
public static int distance(String seq1, String seq2)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w . j a v a 2 s . c o m * find the number of places where the two given strings differ from each * other * * @param seq1 * @param seq2 * @return */ public static int distance(String seq1, String seq2) { int count = 0; for (int i = 0; i < seq1.length(); i++) { if (seq1.charAt(i) != seq2.charAt(i)) { count++; } } return count; } }