This is basic java. It's not Android specific.

String filename = "something.ext";
String extension = null;
int lastDotPosition = filename.lastIndexOf('.');
if( lastDotPosition > 0 ) {
  extension = filename.substring(lastDotPosition + 1);
}


--
Jeremy Wadsack


On Fri, Sep 3, 2010 at 11:57 AM, Pedro Teixeira
<pedroteixeir...@gmail.com>wrote:

> And how is that done?
> I found examples in javascript using the lastindexof ...but cant find
> anything for android java..
>
>
> On Sep 3, 2010, at 6:52 PM, Filip Havlicek wrote:
>
> Just select extension as string from . to the end and filename as string
> from last / to last .
>
> Best regards,
> Filip Havlicek
>
> 2010/9/3 Maps.Huge.Info (Maps API Guru) <cor...@gmail.com>
>
>> Have you looked at File?
>>
>> -John Coryat
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
>
> Pedro Teixeira
>
> www.pedroteixeira.org
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to