These are chat archives for camperbot/bonfire-truncate-a-string

20th
Dec 2015
Makist95
@Makist95
Dec 20 2015 23:17
hint
CamperBot
@camperbot
Dec 20 2015 23:17

hint [1/7]

## :construction: After this are possible spoiler hints.

Make sure you've tried to hard to solve it yourself before proceeding. :construction:

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Makist95
@Makist95
Dec 20 2015 23:17
hint
CamperBot
@camperbot
Dec 20 2015 23:17

hint [2/7]

# Explanation:

We need to reduce the length of the string or truncate it if it is longer than the given maximum lengths specified and add ... to the end. If it is not that long then we keep it as is.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Ray Luxembourg
@RayLuxembourg
Dec 20 2015 23:17
hint
CamperBot
@camperbot
Dec 20 2015 23:17

hint [3/7]

Hint: 1

Strings are immutable in JavaScript so we will need a new variable to store the truncated string.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Ray Luxembourg
@RayLuxembourg
Dec 20 2015 23:17
hint
CamperBot
@camperbot
Dec 20 2015 23:17

hint [4/7]

Hint: 2

You will need to use slice and specify where to start and where to stop.

type hint for next hint :pencil: [Contribute at the FCC Wiki]

Ray Luxembourg
@RayLuxembourg
Dec 20 2015 23:17
hint
CamperBot
@camperbot
Dec 20 2015 23:17

hint [5/7]

Hint: 3

Do not forget that when we truncate the word, we also must count the length added by ...

type hint for next hint :pencil: [Contribute at the FCC Wiki]