Removing Characters from Part Number

Removing Characters from Part Number

GosponZ
Collaborator Collaborator
581 Views
2 Replies
Message 1 of 3

Removing Characters from Part Number

GosponZ
Collaborator
Collaborator

I posted this question and i got perfect answer. Code is still working but i want to upgrade rule. I wish to remove more then "-" from part number. I need one more character to remove. (".")I beleive it is not to hard . Here is code

 

If booleanParam = True Then

        Dim PartNumber As String = iProperties.Value("Project", "Part Number")

        iProperties.Value("Custom", "Program") = PartNumber.Replace("-", "")

Else

        booleanParam = False

        iProperties.Value("Custom", "Program") = ""

 

Thank you

0 Likes
Accepted solutions (1)
582 Views
2 Replies
Replies (2)
Message 2 of 3

rjay75
Collaborator
Collaborator
Accepted solution

Just add the  same type of replacement you have the the "-". You can 'chain' them together.

 

 

If booleanParam = True Then

        Dim PartNumber As String = iProperties.Value("Project", "Part Number")

        iProperties.Value("Custom", "Program") = PartNumber.Replace("-", "").Replace(".","")

Else

        booleanParam = False

        iProperties.Value("Custom", "Program") = ""

0 Likes
Message 3 of 3

GosponZ
Collaborator
Collaborator

Thanks,

i missed dot, .Replace and that is why i had problem.

Again Thank you for help

0 Likes