What happened to this line?

I'm trying to delete everything "from a string named s1, I have this string

s1=replace (s1, """, "")

But I get a compilation error saying what the list separator expects or)

How can i fix this? Thanks in advance.

+3
source share
4 answers

Your second line will not be correctly split. If you want to use quotation mark ( ") inside your string, you need to double it. Since your string consists only of quotation marks, it looks like this:

  • Sign of the quotes to start the line ".
  • Double quotation mark, which is a single row within the quotes, "".
  • Trailing quote ".

In short:

s1 = Replace(s1, """", "")
+7

- , , /.

s1 = Replace(s1, Chr(34), "")

- - , 256 ASCII, Chr().

http://msdn.microsoft.com/en-us/library/4z4t9ed1%28v=VS.80%29.aspx

+4

Are you really writing """? You need to avoid "in the middle - just double it, like:

replace( s1, """", "" )
0
source

Commonly used syntaxes:

s1=replace (s1, "\"", "")
s1=replace (s1, """", "")
s1=replace (s1, '"', "")
0
source

Source: https://habr.com/ru/post/1742492/


All Articles