I am facing an issue on formatting strings.
So i have this variable that has this string value:
7.4.23
What I want to attain is to simply remove the extra trailing dot . so it would look like this: 7.4
CodePudding user response:
With bash and its Parameter Expansion:
version='7.4.23'
echo "${version%.*}"
Output:
7.4