Q:

How do i remove the last character from a string after the last "."

Im working on a python scipt which gets and Ip and calculates the brodcast which just removes the last digest of the ip after the last "." and replaces them with 255
input = "192.168.0.100" 
input = #string operation
print(input)

A:

input = "192.168.0.100" 
loc = input.rfind('.')
inputShort = input[1:loc]
print(loc)
print(inputShort)

rfind finds the last incidence of the "." character and inputShort is then all characters up until, but excluding the last ".".

