Here you can find the source of swapArrayStr(String[] arr)
public static String[] swapArrayStr(String[] arr)
//package com.java2s; public class Main { public static String[] swapArrayStr(String[] arr) { String[] ret = new String[arr.length]; for (int i = 1; i < arr.length; i++) { ret[i - 1] = arr[i].trim();//from w w w . j av a2 s . c om } ret[arr.length - 1] = arr[0]; return ret; } }