|
-
Aug 12th, 2007, 01:46 PM
#1
Thread Starter
Junior Member
[RESOLVED] Placeing Quotations inside Quotations
Is it possible to place quotations in a sentence thats in quotations
For example:
Code:
TextBox2.Text = "My name is "Sunshine" today"
What is the proper way to place quotations inside quotations
-
Aug 12th, 2007, 01:50 PM
#2
Re: Placeing Quotations inside Quotations
Code:
TextBox2.Text = "My name is ""Sunshine"" today"
There are a few methods to do this like using hte Chr(34) instead of the actual double quote character or whatever but they are all just preferences as not much difference in resource useage.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 12th, 2007, 02:06 PM
#3
Thread Starter
Junior Member
Re: Placeing Quotations inside Quotations
Hey Rob can you give me a Code example
-
Aug 12th, 2007, 02:17 PM
#4
Re: Placeing Quotations inside Quotations
Another would be...
Code:
TextBox2.Text = "My name is " & Chr(34) & "Sunshine" & Chr(34) & " today"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 12th, 2007, 02:33 PM
#5
Thread Starter
Junior Member
Re: Placeing Quotations inside Quotations
Okay that worked but
Is there a way i can just place one "
Because for that code it requires me to use both on "Sunshine" and i just need to have one.
Example:
Code:
"My name is " & Chr(34) & "Sunshine & Chr(34) & " today"
But if i don't close the name sunshine it will keep quoting until the next ".
-
Aug 12th, 2007, 02:36 PM
#6
Re: Placeing Quotations inside Quotations
Your missing a double quote after sunshine.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 12th, 2007, 02:42 PM
#7
Thread Starter
Junior Member
Re: Placeing Quotations inside Quotations
 Originally Posted by RobDog888
Your missing a double quote after sunshine.
Thats how i need it to be because after "Sunshine" there will be a number added to it. from another textbox in the same quotation.
Example:
Code:
TextBox2.Text = "My name is " & Chr(34) & "Sunshine" & Chr(34) & Textbox1.Text & Chr(34) & " & Chr(34)
Resulting in this:
My name is "Sunshine27" today
Basically my question would be: Can i have a single " in a & Chr(34) & Like this:
Code:
& Chr(34) " Chr(34) &
Last edited by helio2; Aug 12th, 2007 at 02:46 PM.
-
Aug 12th, 2007, 02:51 PM
#8
Re: Placeing Quotations inside Quotations
When in a string, either " & Chr(34) & " or "" produce a single quotation character (Chr(34) returns a string containing just a single quotation character, and "" is a built-in 'trick' to allow you to use the character within a string).
To have two quotation characters in your string, you can use either " & Chr(34) & Chr(34) & " or """"
-
Aug 12th, 2007, 02:56 PM
#9
Re: Placeing Quotations inside Quotations
Just place a variable to contain the number you want to concatenate with Sunshine.
Code:
TextBox2.Text = "My name is " & Chr(34) & "Sunshine" & SomeVar & Chr(34) & Textbox1.Text & Chr(34) & " & Chr(34)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 12th, 2007, 03:04 PM
#10
Thread Starter
Junior Member
Re: Placeing Quotations inside Quotations
Awesome! Thanks again RobDog888 and si_the_geek !!
This worked
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|