Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/messente/sms-length-calculator
Calculates the SMS length and more
https://github.com/messente/sms-length-calculator
Last synced: 25 days ago
JSON representation
Calculates the SMS length and more
- Host: GitHub
- URL: https://github.com/messente/sms-length-calculator
- Owner: messente
- License: apache-2.0
- Created: 2015-06-12T08:22:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-04T10:03:51.000Z (about 4 years ago)
- Last Synced: 2023-03-02T10:03:31.607Z (almost 2 years ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 32
- Watchers: 13
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMS Length Calculator
Free SMS length calculator for different programming languages.Checks if a message can be sent as GSM 7bit charset or if Unicode charset must be used.
## Java
Usage example
```Java
SmsLengthCalculator calc = new SmsLengthCalculator();
String txt = "The morpheme can be reduplicated to emphasize the meaning of the word";
int sms_parts = calc.getPartCount(txt);
System.out.println("Message with text ["+txt+"] is sent as ["+sms_parts+" SMS]");
```## PHP
Usage example
```PHP
$SmsCalc = new SmsLengthCalculator();
$text = "The morpheme can be reduplicated to emphasize the meaning of the word";
$sms_parts = $SmsCalc->getPartCount($text);
echo "Message with text [".$text."] is sent as [".$sms_parts." SMS]\n";
// Output: Message with text [The morpheme can be reduplicated to emphasize the meaning of the word] is sent as [1 SMS]
```## Scala
Usage example
```Scala
val txt: String = "The morpheme can be reduplicated to emphasize the meaning of the word"
val smsParts: Int = SmsLengthCalculator.getPartCount(txt)
println("Message with text ["+txt+"] is sent as ["+smsParts+" SMS]")
```