Private Sub btnTrim_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTrim.Click Dim sTemp As String Dim sCount As Integer sTemp = "" 'loads a text file into the sTemp string sTemp = GetFileContents(txtPath.Text) 'remove text from begining of the string sTemp = sTemp.Remove("0", "10") 'check how long the sTemp string is now
sCount = sTemp - txtLength.Text
'remove all text after the txtLength number sTemp = sTemp.Remove(txtLength.Text, sCount) txtData.Text = sTemp End Sub