473,325 Members | 2,872 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,325 software developers and data experts.

Question about delimiters.

I'm using the printf function to display some textual information. It is possible that the string may contain different symbols such as $#%^&* somewhere within the text.

I know that to handle the % that I need to use a %% to make the string evaluate correctly.
for example:
Expand|Select|Wrap|Line Numbers
  1. printf "strin%%g"; 
  2.  
will display as strin%g

My question is are there any other symbols that will give me issue using printf like % does? and if so, how do I handle them?


Thanks so much!
Jan 27 '12 #1
2 1475
RonB
589 Expert Mod 512MB
I know that to handle the % that I need to use a %% to make the string evaluate correctly.
That would not work in Perl. Perl uses the backslash to escape special chars.

Why are you using printf without a format specification?

If you don't need to use a format, then use print instead of printf.

If you don't what to interpolate, then use single quotes instead of double quotes.
Jan 27 '12 #2
This can be useful for you
use strict;
use warnings;
print "strin\%g";
Jan 30 '12 #3

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

Similar topics

3
by: Justin L. Kennedy | last post by:
I am looking for a function that takes in a string and splits it using a list of other strings (delimiters) and can return the delimiters as well as the extra parts of the string. I was trying the...
2
by: Y. H. | last post by:
Hi, I'm having the following problem. I'm trying to write a simple parser for a script that looks like this: <command> , , , ... Giving an argument is optional. If it's not present...
2
by: Bill Moran | last post by:
I'm having some problems using \copy I have a directory full of test data that I want to be installed automatically when "make database" is issued. While the Makefile rules would seem simple,...
1
by: Garry Jones | last post by:
Excuse the newbie question. I have seen different types of delimiters to note php code. <?php and ?> and <? and ?> However the code <?= and ?>
9
by: [Mr.] Lynn Kurtz | last post by:
I'm new to javascript and I have run into a problem I bet someone here can help me with. I have a little web page that includes this call to another html file with two parameters: <a...
6
m6s
by: m6s | last post by:
1. After hours of researching, I used these snippets : void Object::TokenizeLines(const string& str, vector<string>& tokens, const string& delimiters) // Skip delimiters at beginning....
4
by: bearophileHUGS | last post by:
This is the best praise of semantic indentation I have read so far, by Chris Okasaki: http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-indentation-for.html A quotation: I have...
1
by: zeny | last post by:
Hey folks! Can anyone tell me how to add data to a table using "copy" with several delimiters? Is it possible? What i mean is: Copy <table_name> from <file_directory> using delimiters...
5
by: gpaps87 | last post by:
hi, i wanted to know whether we can use strtok command to mark delimiters as tokens as well.In Java,we have a command: StringTokennizer(String str, String delimiters, boolean delimAsToken) ...
3
by: minimalPixel | last post by:
Hi All, Sorry for the noob question, but hopefully this is an easy one. I'm not exactly sure if this is a php or a mysql question, but I'm working with a component in Joomla's backend that...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.