Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Shorten SMS Text
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string test1 = "My Company Name"; string phn = "0469293386"; string fulltext = "1234567890 "+test1+" 1234567890 "+phn; //48 char if(fulltext.Length > 48 ) { int lDiff = fulltext.Length - 48; //Console.WriteLine((test1.Length-lDiff).ToString() ); test1 = test1.Remove((test1.Length-lDiff), lDiff); } fulltext = "1234567890 "+test1+" 1234567890 "+phn; Console.WriteLine(fulltext + " Total:"+fulltext.Length); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Some linq examples
first test
Fixing Broken Lines with Regex
encryption
FileNameCharCheck
simultQ
c# kare çizimi
ReplaceNotExpectedCharacters
Working with Dictionaries (csharp)
otro
stackse - search stackoverflow differently
Please log in to post a comment.