# String with quotation mark

**URL:** <https://forum.universal-robots.com/t/string-with-quotation-mark/3291>\
**Category:** URScript\
**Created:** [December 12, 2018, 12:43pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291 "2018-12-12T12:43:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon54922800](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anon54922800](https://forum.universal-robots.com/u/anon54922800)\
**Post date:** [December 12, 2018, 12:43pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/1 "2018-12-12T12:43:06Z")

</div>

Hi,

is there a possibility to send a quotation mark via socket\_send\_string()?

I tried " " " but it didn’t work.

Thank You!

---

<div class="post-metadata">

**Author:** ![anon82484413](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@anon82484413](https://forum.universal-robots.com/u/anon82484413)\
**Post date:** [December 12, 2018, 12:53pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/2 "2018-12-12T12:53:19Z")

</div>

Try with \ " (without space between) that should result in just the quotation mark

---

<div class="post-metadata">

**Author:** ![anon54922800](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anon54922800](https://forum.universal-robots.com/u/anon54922800)\
**Post date:** [December 12, 2018, 1:03pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/3 "2018-12-12T13:03:16Z")

</div>

Hi michael,

i tried to allocate a string:="\ “”, but the allocation was not accepted.

I also tried ’ " ', but that also did not work.

---

<div class="post-metadata">

**Author:** ![inu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/inu/32/732_2.png) [@inu](https://forum.universal-robots.com/u/inu)\
**Post date:** [December 12, 2018, 7:16pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/4 "2018-12-12T19:16:56Z")

</div>

Hello,

There currently isn’t a way to do this, however you can accomplish the same task using this workaround: socket\_send\_string(popup((str\_cat("’’",“test”)),"’’")))

where " ’ ’ " - with no spaces is used instead of double quotes.

If you need the quation to be a string to send to some sort of external device you can test: socket\_send\_string(to\_str("’’")) using the same method I mentioned above- " ’ ’ "

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/4/43ff77bdaab7d91b8d4d866cd60c75977e849002.png)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![dsh](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@dsh](https://forum.universal-robots.com/u/dsh)\
**Post date:** [December 19, 2018, 6:12am UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/5 "2018-12-19T06:12:48Z")

</div>

Hello,

Is it a requirement that you use socket\_send\_string() to send the quotation? I ask because there’s a support article on the support site (here: [How to send a quotation mark via socket communication](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/send-a-quotation-mark-via-socket-communication-45059/)) that talks about this. Instead it discusses using socket\_send\_byte() which allows the use of ASCII characters. Hopefully this will help by giving another potential option.

---

<div class="post-metadata">

**Author:** ![anon54922800](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anon54922800](https://forum.universal-robots.com/u/anon54922800)\
**Post date:** [January 4, 2019, 9:34am UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/6 "2019-01-04T09:34:23Z")

</div>

Hi,

thanks inu and dsh for the solutions.

We use Polyscope V3.7, that´s why I cannot use inu`s solution. The string manipulation functionalities are in V3.8.

Socket\_send\_byte(34) is working for me. I wanted to send data in json-format, to meet the requirements of our customer, a quotationmark is needed in this context.

---

<div class="post-metadata">

**Author:** ![MikeM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mikem/32/3114_2.png) [@MikeM](https://forum.universal-robots.com/u/MikeM)\
**Post date:** [September 19, 2021, 9:12pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/7 "2021-09-19T21:12:00Z")

</div>

@jbm and @inu I would like to resurface this question and or propose this for future functionality of Polyscope, I need help sending a double quote ( " ) over socket communication (trying to avoid RTDE). I have tried all three methods listed in this discussion:

- " or "\ - Polyscope doesn’t like this
- str\_cat("’’") where (" ’ ’ ") but this is still read as TWO single quotes ( ’ ) which will not work for my needs
- socket\_send\_byte(34) - works however (and I’m not too tech savey on the buffer line) when I use a TCPlistener it receives the command in separate lines and it doesn’t always split in the same spot. \*\*Note: this was while using socket\_send\_string() command to avoid “\n” added at end of every piece of the string.

The device reads commands/strings as a single line ending in \n. I have used socket\_send\_line() to communicate with the device and it works fine for most commands even using single quotes within the string.

I can’t share the specific command but let’s say it looks something like this:

```
 String = “Hello World: “URname”, “SomeoneElsesName”,“UR”, “display”, 1”

 Socket_send_line(String)

```

Any help would be great, thanks!

---

<div class="post-metadata">

**Author:** ![tor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/tor/32/1876_2.png) [@tor](https://forum.universal-robots.com/u/tor)\
**Post date:** [November 30, 2022, 1:12pm UTC](https://forum.universal-robots.com/t/string-with-quotation-mark/3291/8 "2022-11-30T13:12:34Z")

</div>

Hi,

I tried your workaround with socket\_send\_string(to\_str(“’’”)), using " ’ ’ " and it looks like it works.

I will send this to an external device at a customer (can’t try right now), but will the device actually see ’ ’ as "? Does to\_str() make them into the same character?
