Make first letter of words uppercase in a string

I have a large array of strings such as this one:

‘INTEGRATED ENGINEERING 5 Year (BSC with a Year in Industry)’

I want to capitalise the first letter of the words and make the rest of the words lowercase. So ‘INTEGRATED’ would become ‘Integrated’.

A second spanner in the works - I want an exception to a few words such as ‘and’, ‘in’, ‘a’, ‘with’.

So the above example would become:

Integrated Engineering 5 Year (Bsc with a Year in Industry).

How would I do this in Go? I can code the loop/arrays to manage the change but the actual string conversion is what I struggle with.

If you only want to capitalize the first letter of a string named input and leave the rest alone:

String output = input.substring(0, 1).toUpperCase() + input.substring(1);

Now output will have what you want. Check that your input is at least one character long before using this, otherwise you'll get an exception.