How do I save/display the return from the splitString()?
How do I save/display the return from the splitString()?
(OP)
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!





RE: How do I save/display the return from the splitString()?
ht
If this isn't part of a journal, ignore the above link!
RE: How do I save/display the return from the splitString()?
I am trying to put this biz logic in a "Note"
RE: How do I save/display the return from the splitString()?
RE: How do I save/display the return from the splitString()?
RE: How do I save/display the return from the splitString()?
CODE
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
I can already think of some improvements for this, but I'll throw it out as is to see if this approach will even work for your situation.
RE: How do I save/display the return from the splitString()?
RE: How do I save/display the return from the splitString()?