Java String Sub String subStrTime(String strTime)

Here you can find the source of subStrTime(String strTime)

Description

sub Str Time

License

Open Source License

Declaration

public static String subStrTime(String strTime) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others. All rights reserved. This program and the
 * accompanying materials are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * //w ww  .  ja  v  a2  s .com
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

public class Main {

    public static String subStrTime(String strTime) {
        String inTime = strTime.substring(0, 2);
        String outTime = strTime.substring(2, strTime.length());
        return inTime + ":" + outTime;
    }
}

Related

  1. substringUntil(String org, int begin, char term)
  2. substringUntilMatch(String string, String match)
  3. subStringWhiteSpaces(String str, int maxLen)
  4. subStringWith3Point(String inputStr, int beginIndex, int length)
  5. subStrOccurences(String str, String findStr)