Good afternoon everybody!
I’m pretty sure it must be obvious but I can’t find how to drop letters from a variable.
Here what I want to do:
Readers can choose their ship’s name. Let’s say I use a variable I name $Vaisseau_nom. At some point I will want to use the ship’s name in the text. Pretty straightforward, I write my text and at some point I use $Vaisseau_nom.
Les moteurs de $Vaisseau_Nom produisent un bruit assourdissant. Let’s say the ship is named La Cigale:
Les moteurs de La Cigale produisent un bruit assourdissant.
(La Cigale’s engines produce a deafening noise in English).
Easy? Sure. But French is quite irritating at this point. Every name in French is either masculine or feminine. So if my ship has a feminine name, the above sentence works perfectly. However if the name is masculine this doesn’t work, the words de le have to become du. Example, with the name Le Dauphin:
Les moteurs du Dauphin produisent un bruit assourdissant.
At this point, I need to drop 'Le ’ from my variable $Vaisseau_nom. There’s plenty of manipulations of numeric variables, but I feel, and I may be very wrong on this, that manipulations of character variables are less documented.
What I need is something quite simple, a function, a feature, anything allowing me to write only the characters from the ‘D’, that’s akin as (R language):
oldstring ← “Le Dauphin”
newstring ← substr(oldstring,4,nchar(oldstring))
newstring is “Dauphin”
I thank you for reading so far!
Twine Version: 2.3.13
Story Format: 2.34.1