Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
skr002244
Contributor III
Contributor III

How to extract a part of a string and display it on the listbox?

Hello, I want to extract a particular portion of a string.So,can anyone tell me the code for it ?

Example-123TY-P1-00TY. In this i want only P1 to be displayed on the listbox .

1 Solution

Accepted Solutions
arulsettu
Master III
Master III

hi

try like this =SubField('123TY-P1-00TY','-',2)

View solution in original post

13 Replies
arulsettu
Master III
Master III

hi

try like this =SubField('123TY-P1-00TY','-',2)

Not applicable

try this

=SubField('123TY-P1-00TY','-',2)

Not applicable

or try this

=SubField(YourField name,'-',2)

Anonymous
Not applicable

hi use the code

=SubField('123TY-P1-00TY','-',2)


skr002244
Contributor III
Contributor III
Author

Thank you . But, I also have the fields in these formats.... 10-P1-12,12-P2-302,100-P3-21 etc... I want to extract the P2,P1... strings.So,how i should i do that ?

skr002244
Contributor III
Contributor III
Author

Thank you . But, I also have the fields in these formats.... 10-P1-12,12-P2-302,100-P3-21 etc... I want to extract the P2,P1... strings.So,how i should i do that ?

its_anandrjs

You can try this code also

=SubField('123TY-P1-00TY','-',-2)

Not applicable

then in place of string use your field name,because what you want is the second part ,hence the code works well for you,

in list box, select expression and type

subfield(fieldname,'-',2)

then your list box will show only P1,P2,P3

Not applicable

find the sample file to see the solution