Cut a String to a shorter String

edited July 2017 in How To...

I am trying to write a function such that it takes an inputted String and creates a new String 'count' characters long. I have this so far:

String stringFront(String s, int count)
{
  for (int l=0; l<count; l++)
  {

  }
}

For example, String stringFront("this is the example", 7) would result in "this is".

Answers

Sign In or Register to comment.