Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.
/ smshelpers Public archive

Helper methods to work with SMS / text messages

License

Notifications You must be signed in to change notification settings

denis-taran/smshelpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helper library to work with SMS / text messages

How can I calculate the number of required SMS parts for a concatenated text message?

var helpers = new SmsHelpers();
var parts = helpers.CountSmsParts(mymessage);

How can I detect encoding required to send a text message?

var helpers = new SmsHelpers();
var parts = helpers.GetEncoding(mymessage);

How can I use the library with dependency injection / IoC?

You only need to register our interface with your DI/IoC provider like this:

public void RegisterDependencies(IServiceCollection services)
{
    services.AddTransient(typeof(ISmsHelpers), typeof(SmsHelpers));
}

How can I normalize new line characters?

var helpers = new SmsHelpers();
var parts = helpers.NormalizeNewLines(mymessage);

How can I split SMS to multiple individual parts with word wrapping?

var helpers = new SmsHelpers();
var splitResult = helpers.SplitMessageWithWordWrap(mymessage);
var parts = splitResult.Parts;
var encoding = splitResult.Encoding;