Java tutorial
//package com.java2s; /** * Copyright (c) 2014, by the Authors: John E Lloyd (UBC) * * This software is freely available under a 2-clause BSD license. Please see * the LICENSE file in the ArtiSynth distribution directory for details. */ public class Main { private static boolean hasDotChar(String path) { int idot = 0; while (idot != -1) { idot = path.indexOf('.', idot); if (idot != -1) { if (path.regionMatches(idot, "../", 0, 3)) { idot += 3; } else if (path.regionMatches(idot, "./", 0, 2)) { idot += 2; } else { return true; } } } return false; } }