Java String Slice sliceAndMatch(String fstring, String rstring)

Here you can find the source of sliceAndMatch(String fstring, String rstring)

Description

slice And Match

License

Open Source License

Declaration

public static String sliceAndMatch(String fstring, String rstring) 

Method Source Code

//package com.java2s;

public class Main {
    public static String sliceAndMatch(String fstring, String rstring) {
        String resultString = "";
        for (int i = 0; i < fstring.length(); i++) {
            String subString = fstring.substring(i, fstring.length());

            if (rstring.startsWith(subString)) {
                resultString += subString + rstring.substring(subString.length());
                break;
            }//from   w  ww .j av a  2s .co m
            resultString += fstring.charAt(i);
        }
        return resultString;
    }
}

Related

  1. slice(int theNum, String[] theStringArray)
  2. slice(String contents, int CONTENT_COLUMN_SIZE)
  3. slice(String input, int index, int length)
  4. slice(String line)
  5. slice(String value, int beginOffset, int endOffset, boolean trim)
  6. sliceLength(int start, int stop, long step)