jerry007
Aerospace
- Jul 18, 2011
- 16
How do I get rid of the first word from a string? For instance, I'd like to display "is a test" from a given string "This is a test". Thanks!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Module NXJournal
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
'***********************************************************************
Sub Main
Dim strPartName as string
Try
strPartName = workPart.GetStringAttribute("DB_PART_NAME")
strPartName = Trim(strPartName)
Catch ex As Exception
strPartName = ""
End Try
'msgbox(strPartName)
if InStr(strPartName, " ") > 0 then
strPartName = Mid(strPartName, InStr(strPartName, " ") + 1)
end if
'msgbox("$" & strPartName & "$")
'the next line will create a new attribute with the processed text, change the name as necessary
workPart.SetAttribute("CUSTOM_PART_NAME", strPartName)
End Sub
'***********************************************************************
End Module