Solved

create spaces in vb string

Posted on 2014-04-27
8
294 Views
Last Modified: 2014-04-27
if this command :- Dim pscommand As Command = New Command("MailboxReport -SAID" & r & "-TXTPATH" & q)

is represented into vb like this : - "MailboxReport -SAID11364-TXTPATHC:\WHATEVER".  

How can I spave the command correctly with spaces to produce this result  : -

"MailboxReport -SAID 11364 -TXTPATH C:\WHATEVER".
0
Comment
Question by:patelbg2001
[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
8 Comments
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 166 total points
ID: 40025612
Hi,

Maybe

Dim pscommand As Command = New Command("MailboxReport -SAID " & r & " -TXTPATH " & q) 

Open in new window

Regards
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 167 total points
ID: 40025625
The & will put the strings together directly.  If you want spaces then just add them into the strings.
0
 
LVL 6

Author Comment

by:patelbg2001
ID: 40025629
like this example ?(Sorry for the basic question, I'm relearning since my stroke)

Dim q As String = physicalFolder.ToString
Dim r As String = TextBox1.Text
Dim firstString As String
Dim secondString As String
Dim startString As String
firstString = "-SAID"
secondString = "-TXTPATH"
firstString = firstString & " "
secondString = secondString & " "
firstString = firstString & r
secondString = secondString & q
firstString = firstString & " "
startString =”MailboxReport”
startString=startString & “ “
Dim pipe As Pipeline = rs.CreatePipeline()
Dim pscommand As Command = New Command(startString &  firstString  &  secondString)
pipe.Commands.Add(pscommand)
pipe.Invoke()

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Accepted Solution

by:
MacroShadow earned 167 total points
ID: 40025660
Either like that, or even better and shorter like Rgonzo1971's suggestion.

Also instead of " " you could use chr(32), which represents a space character.
0
 
LVL 6

Author Comment

by:patelbg2001
ID: 40025723
how would a chr(32) be used?
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 40025726
Dim pscommand As Command = New Command("MailboxReport -SAID" & Strings.Chr(32) & r & Strings.Chr(32) & "-TXTPATH" & Strings.Chr(32) & q)
0
 
LVL 6

Author Comment

by:patelbg2001
ID: 40025782
Thanks, I'll remember that for the future.
B.
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 40025790
No prob.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Huge BLOB data type in Oracle how to retrieve in vb.net and crystal reports 6 46
Crystal reports login after closing form 3 34
Why use this lambda? 12 61
Query in AngularJS 8 43
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

762 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