473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Removing spaces from a line.

489 256MB
This is probably very simple but I'm having a hard time with it. I create a report that is converted into a PDF and it has a name "Preview Final Results.pdf" this name can be anything depending on the report I create. I would like to remove the spaces so the name would be PreviewFinalResults.pdf I think there is also a way to make the name lower case. The reason for this is it gets loaded to a website so it can be viewed but once on the web it doesn't like the spaces. Is there a way to do this.
Thanks for any help,
Jan 29 '14 #1

✓ answered by Luk3r


6 1190
Luk3r
300 256MB
1) Use the Replace() function.
http://msdn.microsoft.com/en-us/libr...=vs.90%29.aspx
2) Use the LCase() function.
http://msdn.microsoft.com/en-us/libr.../gg264497.aspx
Jan 29 '14 #2
ADezii
8,834 Expert 8TB
As indicated by Luk3r, the Replace() Function nested within the LCase() Function will do the trick, as in:
Expand|Select|Wrap|Line Numbers
  1. Dim strTest As String
  2.  
  3. strTest = "SHE           SELLS     SeaShELLs BY tHe seashoRE!"
  4. Debug.Print LCase(Replace(strTest, " ", ""))
  5.  
OUTPUT:
Expand|Select|Wrap|Line Numbers
  1. shesellsseashellsbytheseashore!
Jan 29 '14 #3
CD Tom
489 256MB
@ADezii
Worked perfect. Thanks
Jan 29 '14 #4
ADezii
8,834 Expert 8TB
You are quite welcome, CD Tom.
Jan 29 '14 #5
zmbd
5,501 Expert Mod 4TB
Per ADezii's request:
After reviewing the thread, Luk3r provided the basis for the solution.

ADezii, thank you for pointing this out, as always an Officer and a Gentleman (^_^)
Jan 30 '14 #6
NeoPa
32,556 Expert Mod 16PB
ADezii's too modest.

Going by the OP's response I would say that it was ADezii's post he found most helpful.

That said, Luk3r's post provided the basis for the answer so I'm happy it should show as BA.

If ADezii's answer had been provided by the OP then it would not have been allowed as BA in those circumstances of course
Jan 30 '14 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Aaron Collins | last post by:
Hello, i have a string that was entered in a web form and stored in a mysql database where the user entered carriage returns as well as <br>'s after each line in the form. the data is stored as...
9
by: hokiegal99 | last post by:
This script works as I expect, except for the last section. I want the last section to actually remove all spaces from the front and/or end of filenames. For example, a file that was named " test ...
1
by: Billy Cormic | last post by:
Hello, This is a simple question, hopefully with a simple answer. I have an nvarchar column of length 255. In one of the rows I have the following sentance - 'See the brown ball bounce'. Is it...
5
by: Jonathan Daggar | last post by:
Hello, I'm trying to put together a form with a very tight table formatting. However, every time I put an text-type input field in, the browser pads the area to the right of it with space. I've...
12
by: Magix | last post by:
Hi, Everytime I received a fix-length of string, let say 15 (the unused portion will filled with Spaces before receive), I want to remove the Spaces from END until I encounter a non-space char....
1
by: Mike in Paradise | last post by:
Is there a more effcient way of removing the spaces from the names for a Enumerated value that has several values when you split it)??? When you do a toString it puts ,<SPACE> between the entries...
3
by: lino | last post by:
Hello, I have the following string: const char plaintext = "Fourscore and seven years ago our \ fathers brought forth upon this continent \ a new nation, conceived in liberty, and dedicated...
2
by: warthogweb | last post by:
This is in relation to BANFA's succinct reply to my post the other day. I have a bunch of phone numbers that contain one or two spaces and that I want to get consistent by removing them. However,...
6
by: bigbenwallace | last post by:
I was wondering if someone can show me how to remove spacing and punctuations from a line of input using character functions(such as is punct., is space) I also want to use a for loop to do it. I...
11
by: ramu | last post by:
Hi, Suppose I have a string like this: "I have a string \"and a inner string\\\" I want to remove space in this string but not in the inner string" In the above string I have to remove...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.