On Sat, 2008-12-13 at 02:14 -0800, Vicky wrote: > Is there any way to take out the first letter of a string in django > template system? > ex: > > x("Hai") should give o/p as: "H"
The "slice" filter has already been suggested, but this is a case of the template system providing more than one way to do something (for better or worse). You could also use the "first" filter: {{ var|first }} or even {{ "Hai"|first }} Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---