Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Comparação de String

From Wiki
Jump to: navigation, search
Article Metadata

Artigo
Tradução:
Originado de String comparison
Por TK2000
Última alteração feita por hamishwillee em 09 Dec 2011


TBuf<50>	Buffer;
 
Buffer.Copy( _L( "somestring" ) );
 
/*
* Compara a primeira letra
*
* TPtrC Left( TInt aLenght )
*
*/

if( !( Buffer.Left( 1 ).Compare( _L( "A" ) ) ) )
{
// faz algo
}
 
 
/*
* Compara a última letra
*
* TPtrC Right( TInt aLenght )
*
*/

if( !( Buffer.Right( 1 ).Compare( _L( "o" ) ) ) )
{
// faz algo
}
 
 
/*
* Compara da letra do meio até o final
*
* TPtrC Mid( TInt APos )
*
*/

if( !( Buffer.Mid( 5 ).Compare( _L( "xyz" ) ) ) )
{
// faz algo
}
 
 
/*
* Compara N letras
*
* TPtrC Mid( TInt APos , TInt aLenght )
*
*/

if( !( Buffer.Mid( 2 , 3 ).Compare( _L( "xp" ) ) ) )
{
// faz algo
}
This page was last modified on 9 December 2011, at 04:55.
216 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×