[Swift-commit] r5550 - trunk/docs/userguide

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon Feb 6 15:26:50 CST 2012


Author: davidk
Date: 2012-02-06 15:26:50 -0600 (Mon, 06 Feb 2012)
New Revision: 5550

Modified:
   trunk/docs/userguide/app_procedures
Log:
Add sprintf to the userguide


Modified: trunk/docs/userguide/app_procedures
===================================================================
--- trunk/docs/userguide/app_procedures	2012-02-06 17:08:58 UTC (rev 5549)
+++ trunk/docs/userguide/app_procedures	2012-02-06 21:26:50 UTC (rev 5550)
@@ -324,6 +324,27 @@
 
 will assign the value "abmonkeyhi" to the variable v.
 
+ at sprintf
+~~~~~~~~
+ at sprintf(spec, variable list) will generate a string based on the specified format.
+-----
+Example: string s = @sprintf("\t%s\n", "hello");
+-----
+   
+Format specifiers
+[width="100%",frame="topbot"]
+|======================
+|%%| % sign
+|%M| Filename output (waits for close)
+|%p| Format variable according to an internal format
+|%b| Boolean output
+|%f| Float output
+|%i| int output
+|%s| String output
+|%k| Variable sKipped, no output
+|%q| Array output
+|======================
+
 @strcat
 ~~~~~~~
 @strcat(a,b,c,d,...) will return a string containing all of the




More information about the Swift-commit mailing list