zoukankan      html  css  js  c++  java
  • C# 字符串中英文对齐

    StringBuilder str = new StringBuilder();
    str.AppendFormat("楼盘名称:{0},房源总数:{1}
    ", "绿地海外滩中心" + new string(' ', 25 - Encoding.Default.GetBytes("绿 地海外滩中心").Length), 10);
    str.AppendFormat("楼盘名称:{0},房源总数:{1}
    ", "上海医药大厦" + new string(' ', 25 - Encoding.Default.GetBytes("上海 医药大厦").Length), 10);
    str.AppendFormat("楼盘名称:{0},房源总数:{1}
    ", "世纪巴士大厦(中海大厦)" + new string(' ', 25 - Encoding.Default.GetBytes("世纪巴士大厦(中海大厦)").Length), 10);
    Console.WriteLine(str.ToString());
    Console.ReadKey();

  • 相关阅读:
    poj3686 Windys
    poj3155 Hard Life
    luoguP2774 方格取数问题
    poj3469 Dual Core CPU
    poj3281 Dining
    luogu P3410 拍照
    离散化
    最短路(SPFA)
    lower_bound && upper_bound
    gcd
  • 原文地址:https://www.cnblogs.com/zhyue93/p/Csharp_pad.html
Copyright © 2011-2022 走看看