M moishy Registered User. Local time Today, 15:53 Joined Dec 14, 2009 Messages 264 Jan 19, 2012 #1 Hello to All, How can I add a double-quotation mark (") before the last chr in a string?
P plog Banishment Pending Local time Today, 07:53 Joined May 11, 2011 Messages 12,010 Jan 20, 2012 #2 This should work: ReturnValue=Mid([FieldName],1,Len([FieldName])-1) & '"' & Mid([FieldName],Len([FieldName]),1)
This should work: ReturnValue=Mid([FieldName],1,Len([FieldName])-1) & '"' & Mid([FieldName],Len([FieldName]),1)
M moishy Registered User. Local time Today, 15:53 Joined Dec 14, 2009 Messages 264 Jan 20, 2012 #3 So I tried this Code: r$ = Mid(r$, 1, Len(r$) - 1) & '"' & Mid(r$,Len(r$),1)" and I got a Compile Error: Expected Expression
So I tried this Code: r$ = Mid(r$, 1, Len(r$) - 1) & '"' & Mid(r$,Len(r$),1)" and I got a Compile Error: Expected Expression
R raskew AWF VIP Local time Today, 07:53 Joined Jun 2, 2001 Messages 2,734 Jan 20, 2012 #4 Hi - Try this (example from the debug/immediate window): x = "the quick brown fox" ? Mid(x,1,Len(x)-1) & """" & Mid(x,Len(x),1) the quick brown fo"x Click to expand... -or- ? Mid(x,1,Len(x)-1) & chr(34) & Mid(x,Len(x),1) the quick brown fo"x Click to expand... HTH - Bob
Hi - Try this (example from the debug/immediate window): x = "the quick brown fox" ? Mid(x,1,Len(x)-1) & """" & Mid(x,Len(x),1) the quick brown fo"x Click to expand... -or- ? Mid(x,1,Len(x)-1) & chr(34) & Mid(x,Len(x),1) the quick brown fo"x Click to expand... HTH - Bob
speakers_86 Registered User. Local time Today, 08:53 Joined May 17, 2007 Messages 1,919 Jan 20, 2012 #5 Chr(34) is a double quotes. Code: YourString="Some string" & chr(34)
M moishy Registered User. Local time Today, 15:53 Joined Dec 14, 2009 Messages 264 Jan 20, 2012 #6 raskew, This is the only way it works, putting in the string wrapped id double quotation marks. Code: ? Mid("the quick brown fox",1,Len("the quick brown fox")-1) & chr(34) & Mid("the quick brown fox",Len("the quick brown fox"),1) But if I try this it doesn't work Code: ? Mid(r$,1,Len(r$)-1) & chr(34) & Mid(r$,Len(r$),1) r$ holds a value of "the quick brown fox".
raskew, This is the only way it works, putting in the string wrapped id double quotation marks. Code: ? Mid("the quick brown fox",1,Len("the quick brown fox")-1) & chr(34) & Mid("the quick brown fox",Len("the quick brown fox"),1) But if I try this it doesn't work Code: ? Mid(r$,1,Len(r$)-1) & chr(34) & Mid(r$,Len(r$),1) r$ holds a value of "the quick brown fox".
gemma-the-husky Super Moderator Staff member Local time Today, 13:53 Joined Sep 12, 2006 Messages 16,048 Jan 20, 2012 #7 i ytend to use the method jack outlined in #5 use chr(34). it is much easier than getting the right syntax for wrapping the actual quote character this sort of thing newstrg = leftstrg(string, 12) & chr(34) & mid(string,13)
i ytend to use the method jack outlined in #5 use chr(34). it is much easier than getting the right syntax for wrapping the actual quote character this sort of thing newstrg = leftstrg(string, 12) & chr(34) & mid(string,13)
boblarson Smeghead Local time Today, 05:53 Joined Jan 12, 2001 Messages 32,059 Jan 22, 2012 #8 Don't be using $ in your variables. It is an old, outdated way of doing it, which can cause issues now days.
Don't be using $ in your variables. It is an old, outdated way of doing it, which can cause issues now days.