Here you can find the source of charCount(String subject, String needle)
private static int charCount(String subject, String needle)
//package com.java2s; /**/*ww w.j av a 2s . com*/ * Mule Rest Module * * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ public class Main { private static int charCount(String subject, String needle) { return subject.split(needle).length - 1; } }