🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

I have to remove ".1.3" from the string.

User: "Jouher_20929"
Altair Community Member
Updated by Jouher_20929

'hello.A  at  strain rate:=1000.235 per milli-second.1.3' Consider this string. I have to remove '.1.3' from last word of string and give whole string back. It should be generic. That is, from last word i have to remove every characters after '.' [including '.']

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi,

    if the last word of STR is 'second' :

    set STR [string range $STR 0 [string last second $STR]+5]

     

    or 

    regsub second.* $STR second STR