string.format

    0熱度

    1回答

    我似乎無法格式化由RSS生成器文件創建的RSS feed靜態文件項目中的pubDate。我可以在RSS提要的標題中正確生成它,但是我無法使String.Format正常工作;如果我使用{}來環繞字符串,它不會使用括號{},但它會繼續輸出字符串,然後會導致錯誤。 public void WriteToFile() { string strDate = null; strDate = "dd

    2熱度

    2回答

    檢查下面的代碼片斷, namespace TestDateConvertion { class Program { static void Main(string[] args) { DateTime testValue = new DateTime(2013, 12, 15, 15, 33, 44); CultureIn

    0熱度

    1回答

    String.Format("args.{0} = '{1}'", dynaform.RequiredModelName, dynaform.RequiredModel) 預期結果輸出正確的語法: args.myVariable = 'someOtherStuff' 實際結果: args.myVariable = 'someOtherStuff' 第二次嘗試: Html

    1熱度

    1回答

    我將在報告中顯示新西蘭和澳大利亞銀行賬戶,並根據用戶提供的自定義格式進行格式化。例如,新西蘭銀行賬戶可以是00-0000-0000000-000,最後一位數字(銀行賬戶後綴)是可選的。有格式的兩個部分: 短線安置 2位數的前綴 樣品格式化銀行賬戶可以01-1234-1234567-55和01-1234-1234567-002 。銀行賬戶沒有任何格式存儲在數據庫中。當我嘗試String.Format

    11熱度

    4回答

    我毫無疑問錯過了一些非常明顯的東西,但我無法弄清楚。任何幫助,將不勝感激。該錯誤是從這裏來的: package B00166353_Grades; public class Student{ String name,banner; public Student(String name,String banner){ this.name=name;

    0熱度

    2回答

    我有以下格式的字符串:130606082236。現在需要將其轉換爲DateTime格式,格式爲2013-06-06 08:22:36,000。我如何創建自定義格式方法並將其轉換?

    0熱度

    2回答

    這讓我撓了撓頭。 我有一個返回一個包含類JSON數據自動完成控制一個字符串的函數,但不能得到String.Format工作: private string GetUsers(string crit) { string result = ""; using (DataTable dt = dl.GetRecordSet("select ob_id, ob_desc from

    0熱度

    1回答

    我使用下面的代碼來構建一個固定長度的文本文件。 TestFile.WriteLine(string.Format( //Formats with negative numbers are left justified. e.g. {1,-10} "{0,50}" + //SPACER 50 "{1,-10}" + //NCSBN ID

    2熱度

    1回答

    我使用這個命令: self.licenseBox.insert(END, "{:30}{:90}{:20}{:5}".format(item[0], item[1], item[2], item[3])) 但.format將增加那麼項目的列寬。例如if item[0] = "foo",第一列的寬度爲33,意味着以下參數爲三。 任何解決方法?

    0熱度

    2回答

    我正在使用StringBuilder構建一個長查詢。 StringBuilder sb = new StringBuilder(); sb.append("select * from x where name = %s'"); String.format(sb.toString, "John"); 什麼會等同於這樣的事情?或者,這實際上是正確的做法嗎?