Java String Clone cloneString(String str)

Here you can find the source of cloneString(String str)

Description

clone String

License

Open Source License

Declaration

public static String cloneString(String str) 

Method Source Code

//package com.java2s;
/*//from w w  w . jav a 2 s.  co  m
 * [y] hybris Platform
 *
 * Copyright (c) 2000-2014 hybris AG
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of hybris
 * ("Confidential Information"). You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the
 * license agreement you entered into with hybris.
 *
 *
 */

public class Main {
    public static String cloneString(String str) {
        if (str == null) {
            return null;
        } else {
            return new String(str.getBytes().clone());
        }
    }
}

Related

  1. cloneString(final String toClone)
  2. cloneString(String input)
  3. cloneString(String sOriginal)