-1

I want to convert a "title" which can have whitespaces in it like " this is a Test title " to a string where all whitespaces are removed and the words which were previously separated by the whitspaces are all starting with capital letters. The result of the above string should be "ThisIsATestTitle".

Goal is to create a string which then can be used as a folder name for the filesystem.

1
  • 1
    What have you tried so far? Commented May 11, 2022 at 8:55

2 Answers 2

4

In MsAccess VBA:

replace(strconv(" this is a Test   title   ",vbProperCase)," ","")

returns ThisIsATestTitle

Thanks @June7 for giving this useful info:

If expression in query or textbox, use 3 in place of vbProperCase.

1
  • 2
    If expression in query or textbox, use 3 in place of vbProperCase.
    – June7
    Commented May 11, 2022 at 9:50
2

Goal is to create a string which then can be used as a folder name for the filesystem.

Then you have a few more things to do.

Non-trailing spaces are not a problem, but a lot of other characters are. In particular, you need to remove all occurences of <, >, :, ", /, \, |, ? and *.

There are a few special edge cases as well: For example, you can't use any of the "reserved names" (COM1 etc.) and your name must not end with a period. For a full list, see Microsoft's official documentation:

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.