?
Solved

@explode with "\" caracter

Posted on 2003-04-01
11
Medium Priority
?
274 Views
Last Modified: 2013-12-18
Hi,
i have a string like "Air Provider\Air Iberia"
and i want to explode this using the "\" as a separator caracter.
The simple way @explode("Air Provider\Air Iberia";"\") does not work neither does @explode("Air Provider\Air Iberia";"\\")
Do you have eny idea how to do that?

Thanks,
Koray.
0
Comment
Question by:koray_uygun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
11 Comments
 

Author Comment

by:koray_uygun
ID: 8244535
Here is the code
     entryTitle = "Air Provider\Air Iberia"
     Dim a
     Dim b
     b="@explode(""" & docEntry.cName(0) & """;""\\"")"
     a = Evaluate(b,docEntry)

a gives : "Air ProviderAir Iberia"
0
 

Author Comment

by:koray_uygun
ID: 8244549
Sorry here is the good one
    entryTitle = "Air Provider\Air Iberia"
    Dim a
    Dim b
    b="@explode(""" & entryTitle & """;""\\"")"
    a = Evaluate(b,docEntry)
0
 

Author Comment

by:koray_uygun
ID: 8244648
Here is the code
     entryTitle = "Air Provider\Air Iberia"
     Dim a
     Dim b
     b="@explode(""" & docEntry.cName(0) & """;""\\"")"
     a = Evaluate(b,docEntry)

a gives : "Air ProviderAir Iberia"
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:hshevitz
ID: 8245450
The problem with your example is that the string for

entryTitle = "Air Provider\Air Iberia"

should be

entryTitle = "Air Provider\\Air Iberia"  '(2 \\)

to work correctly.

This works:

     entryTitle = "Air Provider\\Air Iberia"
     Dim a
     Dim b
     b=|@explode("| & entryTitle & |" ; "\\")|
     a = Evaluate(b,docEntry)

HS
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8245466
I used the | character instead of quotes as it makes it easier to write the eval expression without all the double quotes.
0
 

Author Comment

by:koray_uygun
ID: 8245509
Sorry hshevitz but in fact i am getting a field value in entryTitle, so i cannot put \\ now. It is a field that serves me to create virtual categories if you see what i mean. Fo the moment i have e temporary and may be definitive solution. In the document where i get this value, i have created a hidden multivalue computed field and i put @explode as his value and i get the values of that hidden field in my script.

Thank you anyway.

Koray.
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8245612
If you are getting a field value, you would need to replace the "\" character with "\\". Then the Evaluate would work in your LotusScript. Nothing wrong with the workaround that you did with a computed field.

HS
0
 

Author Comment

by:koray_uygun
ID: 8245650
Yeah, nothing really wrong but it is one more field with redundant information. I like clean developpements ;-)
0
 
LVL 4

Expert Comment

by:hshevitz
ID: 8245678
I know what you mean ;-)
0
 
LVL 1

Accepted Solution

by:
rafez earned 200 total points
ID: 8257665
You will need to do a LS replacestring, to get the other "\" in.

Here's the code that should get it to work

Function LSReplaceSubString(inputString As String, findString As String, replaceString As String) As String
     ' Replaces characters within a string another character
     Dim tempString As String
     Dim findPos As Integer
     Dim startSearchAt As Integer
     tempString = inputString
     findPos = Instr(tempString, findString)
     While findPos
          tempString = Left$(tempString, findPos - 1) & replaceString & Right$(inputString, Len(tempString) - (findPos + Len(findString)) + 1)
          findPos = Instr(findPos + Len(replaceString), tempString, findString)
     Wend
     LSReplaceSubString = tempString
End Function

Sub Initialize
     Dim entryTitle As String
     
     entryTitle = "Air Provider\Air Iberia"
     Dim a
     Dim b
     b=LSReplaceSubstring( entryTitle , "\" , "\\" )
     c = {@Explode("} & b & {";"\\" )}
     a = Evaluate( c,docEntry)
     
End Sub
0
 

Author Comment

by:koray_uygun
ID: 8259673
That works, thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question