forked from IF-LK-2020/array
prefix() finished
This commit is contained in:
10
Arrays.java
10
Arrays.java
@@ -289,7 +289,15 @@ public class Arrays {
|
||||
* zum Beispiel <code>["+String 1","+String 2"]</code>.
|
||||
*/
|
||||
public String[] prefix( String[] pArray, String pPrefix ) {
|
||||
return null;
|
||||
if( pArray.length == 0 ) {
|
||||
return new String[0];
|
||||
}
|
||||
for(int i=0;i<pArray.length;i++){
|
||||
|
||||
pArray[i]=pPrefix+pArray[i];
|
||||
|
||||
}
|
||||
return pArray;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user