-4

The method in question looks like:

Public static String cut (String s, int size){
    Return "";
}
shmosel
  • 49,289
  • 6
  • 73
  • 138
  • 4
    Possible duplicate of [Trim a string based on the string length](https://stackoverflow.com/questions/8499698/trim-a-string-based-on-the-string-length) – Frou-Frou Fox Mar 28 '18 at 19:44

1 Answers1

0

There is String.substring() to cut off a string.

Example of how to use:

"hamburger".substring(4, 8) returns "urge"
"smiles".substring(1, 5) returns "mile"

In your case it would be:

"hamburger".substring(0, 4) returns "hamb"

Docs: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#substring(int,%20int)

rollstuhlfahrer
  • 3,988
  • 9
  • 25
  • 38