~lubuntu-software-center-team/lubuntu-software-center/vala-port

« back to all changes in this revision

Viewing changes to src/Utils.vala

  • Committer: Stephen Smally
  • Date: 2012-03-04 12:59:13 UTC
  • Revision ID: eco.stefi@fastwebnet.it-20120304125913-bk1iutifwoeoyo0i
Worked a lot!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
namespace Lsc.Utils {
 
3
    public string nicer_pkg_name (string pkg_name) {
 
4
        return capitalize_str(pkg_name.replace("-", " "));
 
5
    }
 
6
    
 
7
    public string capitalize_str (string str) {
 
8
        StringBuilder build = new StringBuilder();
 
9
        build.append_unichar(str[0].toupper());
 
10
        for (int x = 1; x < str.length; x++) {
 
11
            build.append_unichar(str[x]);
 
12
        }
 
13
        return build.str;
 
14
    }
 
15
}
 
 
b'\\ No newline at end of file'