escaping

Using quote inside strings in Delphi [duplicate]

我们两清 提交于 2019-12-19 12:24:57
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How does one escape characters in Delphi string In Delphi a string is contained within a pair of ' but I need to use ' in my string... and when I use one it brings a end to the entire string identification. 'inside string ' but this bit is outside' inside again' and the end Is there some symbol that removes the coding affect of the next character? 回答1: You need another quote to escape a quote: Writeln('I''m in

How to go to the previous line in a C code

时光怂恿深爱的人放手 提交于 2019-12-19 10:18:23
问题 If for the following code: printf("HEllo\n"); // do not change this line. printf("\b\bworld"); I need an output: Helloworld (In a single line). But this does not work fine. Could anyone please explain the reason? And other escape sequence if any. 回答1: Remove "\n" from your first printf. It moves the cursor to a new line. Here is the list of escape sequences. If you can't remove "\n", then you can do make a copy of a substring without these charaters. See the following example: const char*

escape less / greater than javascript

和自甴很熟 提交于 2019-12-19 08:59:41
问题 I'm having a problem trying to escape some code... Basically, I want to escape "<" and ">" but I want them to APPEAR in my #output div as "<" and ">". Currently, they appear as as "<" and ">" on the page. This is obviously to prevent anyone exploiting / injecting scripts on the page. This is my code: var textval = $("#textarea").val(); //textarea filtered = textval.replace(/</gi,"<"); //replace "<" $("#output").html(filtered); //insert textarea data into div Can anybody spot what I am doing

SQL Escape ' '

北慕城南 提交于 2019-12-19 07:39:23
问题 I am trying to run a query in SQL 2008 by doing: @query varchar(max) SET @query = 'SELECT * FROM Table WHERE [Name] = ' 'Karl' ' ' EXEC(@query) The problem is that for some reason the apostrophes around 'Karl' don't get escaped, i.e. the query executes as ...WHERE [Name] = Karl and fails. Anyone have a suggestion? Thanks Karl 回答1: There are several ways that you can escape character data in SQL Server, some people even advocate the use of the QUOTENAME() functions. If you really want to

Escape special characters in mount command

痴心易碎 提交于 2019-12-19 06:36:22
问题 I am trying to mount a windows shared folder on Mac OSX Mavericks. A simplistic user name and password worked fine mount -t smbfs //user2:password2@server1.mydomain.com/myproject ~/localmap On trying out the more valid user name and password I am getting errors that parsing URL failed. The details are Username: mydomain\user1 Password: A%b$c@d!e#f The command tried is mount -t smbfs //mydomain\user1:A%b\$c\@d\!e#f@server1.mydomain.com/myproject ~/localmap Based on what I found, $ and ! needs

Git clone with password @

六眼飞鱼酱① 提交于 2019-12-19 06:06:22
问题 I need to escape the @ that use the password because it is confused with the host. Example 1: git clone https://user:p@ssword@github.com/user/repo.git When I run the above example, it's wrong, because as the password has @ he understands that the next parameter is the host. tried to escape with \ or you can use the url between "" but it was not. Example 2: (echo user; echo p@ssword) | git clone https://github.com/usuario/repo.git When I use only the command, git clone https://github.com

Git clone with password @

[亡魂溺海] 提交于 2019-12-19 06:06:12
问题 I need to escape the @ that use the password because it is confused with the host. Example 1: git clone https://user:p@ssword@github.com/user/repo.git When I run the above example, it's wrong, because as the password has @ he understands that the next parameter is the host. tried to escape with \ or you can use the url between "" but it was not. Example 2: (echo user; echo p@ssword) | git clone https://github.com/usuario/repo.git When I use only the command, git clone https://github.com

Objective-C - How to convert NSString to escaped JSON string?

老子叫甜甜 提交于 2019-12-19 03:55:10
问题 I have a NSString that may contain quotes,\, /, \r, \n, and I want to convert it to a JSON encoded string so strings like this "text1\text2" becomes \"text1\\text2\" Is there a existing function to let me do this? Also, I am using SBJson in my project but I cannot find whether SBJson can do this or not. NSJSONSerialization is not on the table since my application still needs to support OSX 10.6 回答1: Does this answer your question? -(NSString *)JSONString:(NSString *)aString { NSMutableString

PHP - Getting rid of curly apostrophes

淺唱寂寞╮ 提交于 2019-12-19 03:07:26
问题 I'm trying to get rid of curly apostrophes (ones pasted from some sort of rich text doc, I imagine) and I seem to be hitting a road block. The code below isn't working for me. $word = "Today’s"; $search = array('„', '“', '&#146;'); $replace = array('"', '"', "'"); $word = str_replace($search, $replace, htmlentities($word, ENT_QUOTES)); What I end up with is $word containing 'Today&#146;s'. When I remove the ampersands from my $search array, the replace takes place but this, obviously, will

PHP - Getting rid of curly apostrophes

半世苍凉 提交于 2019-12-19 03:07:21
问题 I'm trying to get rid of curly apostrophes (ones pasted from some sort of rich text doc, I imagine) and I seem to be hitting a road block. The code below isn't working for me. $word = "Today’s"; $search = array('„', '“', '&#146;'); $replace = array('"', '"', "'"); $word = str_replace($search, $replace, htmlentities($word, ENT_QUOTES)); What I end up with is $word containing 'Today&#146;s'. When I remove the ampersands from my $search array, the replace takes place but this, obviously, will