Use drop and take instead of substring.