Android String Insert insertString(String sourceStr, int position, String insertStr)

Here you can find the source of insertString(String sourceStr, int position, String insertStr)

Description

insert String

Declaration

public static String insertString(String sourceStr, int position,
        String insertStr) 

Method Source Code

//package com.java2s;

public class Main {

    public static String insertString(String sourceStr, int position,
            String insertStr) {/* w w  w  .  j  a v  a2 s .  c  om*/
        int i = position - 1;
        String newString = sourceStr.substring(0, i) + insertStr
                + sourceStr.substring(i, sourceStr.length());

        return newString;
    }
}