using System; class Program { static void Main() { // Sample input containing phone numbers string inputText = "+91 88968 53988, +91 98399 88773, +91 83548 15081, +91 97936 83013, +91 97958 69940, +91 98380 95172, +91 81879 97892, +91 94159 70080, +91 90459 88002, +91 97944 13572, +91 75994 86096, +91 94537 71614, +91 96962 72867, +91 78974 21895, +91 94534 75490, +91 73807 43908, +91 70682 02312, +91 85283 23114, +91 91250 46353, +91 96164 11670, +91 70687 80225, +91 94537 58424, +91 6387 919 087, +91 91988 68807, +91 91253 09698, +91 88749 99658, +91 99845 88999, +91 94158 67548, +91 95068 33076, +91 99191 66001, +91 98891 74212, +91 94500 86924, +91 95985 49285, +91 99352 62248, +91 94158 67672, +91 76077 73899, +91 94509 64273, +91 73989 39440, +91 94515 43695, +91 94547 11952, +91 81740 73712, +91 99355 61986, +91 94511 94899, +91 99567 49427, +91 94512 32697, +91 84395 81255, +91 99360 65121, +91 98898 86594, +91 94537 56233, +91 88530 58768, +91 99365 83197, +91 79853 62107, +91 97933 32188, +91 77848 51886, +91 94510 93622, +91 88589 85900, +91 99366 59624, +91 99353 82823, +91 94553 36077, +91 99357 02913, +91 98896 54190, +91 91702 26222, +91 94517 20813, +91 73985 75651, +91 94503 30133, +91 6306 878 994, +91 6386 270 700, +91 6386 576 781, +91 6387 677 667, +91 6392 657 718, +91 6392 753 838, +91 6394 503 177, +91 6394 956 628, +91 70071 56797, +91 70078 28816, +91 70178 43348, +91 70524 80635, +91 70545 05002, +91 70682 17970, +91 70687 85421, +91 70800 24225, +91 72530 07688, +91 72690 40595, +91 72752 80177, +91 72756 44473, +91 73092 40715, +91 73095 83514, +91 73552 49203, +91 73552 63552, +91 73552 97053, +91 73555 68891, +91 73556 04775, +91 73559 96077, +91 73763 17899, +91 73763 24170, +91 73765 59608, +91 73792 60699, +91 73793 82978, +91 73806 32311, +91 73885 91564, +91 73887 57320, +91 73983 48799, +91 73983 76049, +91 73986 19768, +91 73986 63772, +91 73986 93438, +91 73987 64300, +91 73989 69993, +91 73989 94530, +91 75219 25555, +91 75238 82187, +91 75700 08004, +91 75710 58688, +91 76073 40841, +91 76073 80523, +91 76075 34706, +91 76180 45262, +91 76518 41755, +91 76518 73191, +91 77058 26344, +91 77528 66792, +91 77529 31619, +91 77550 63164, +91 78390 01397, +91 78603 63240, +91 78803 93927, +91 78870 32091, +91 78974 53967, +91 79054 96983, +91 79056 60691, +91 79850 05993, +91 79854 37145, +91 79857 10611, +91 80040 80528, +91 80042 26671, +91 80044 51138, +91 80044 51736, +91 80044 92142, +91 80044 93211, +91 80048 50772, +91 80048 50848, +91 80053 14792, +91 80061 97533, +91 80090 01245, +91 80094 01423, +91 80098 52997, +91 80098 54677, +91 80099 30391, +91 80527 51443, +91 80577 28463, +91 80812 21022, +91 80903 15573, +91 81150 21874, +91 81152 84815, +91 81154 14539, +91 81155 42528, +91 81714 78541, +91 81730 30403, +91 81739 15208, +91 81739 46140, +91 81739 82622, +91 81758 01035, +91 81788 54726, +91 81919 43132, +91 82738 05071, +91 82990 49926, +91 82990 99754, +91 82991 19323, +91 82991 21136, +91 82992 14208, +91 82992 26795, +91 82992 78210, +91 82994 77080, +91 82994 93252, +91 83033 46215, +91 83170 95819, +91 83180 78176, +91 83180 85584, +91 83185 31047, +91 83187 70575, +91 83189 90297, +91 83550 47981, +91 83818 38942, +91 83820 13595, +91 83820 20616, +91 83829 82694, +91 84000 59515, +91 84003 41339, +91 84008 61981, +91 84008 90190, +91 84178 18483, +91 84198 86851, +91 84230 40189, +91 84230 76536, +91 84233 36826, +91 84235 58056, +91 84238 20403, +91 85281 28353, +91 85428 18623, +91 85429 30830, +91 85429 96485, +91 85459 33828, +91 85760 03238, +91 86011 31458, +91 86017 24882, +91 86017 78157, +91 86018 06851, +91 86872 72797, +91 87073 84825, +91 87078 52095, +91 87268 85158, +91 87268 91342, +91 87378 23211, +91 87378 24314, +91 87378 79187, +91 87560 63963, +91 87653 65663, +91 87656 24340, +91 87872 72193, +91 87996 60441, +91 88086 76627, +91 88088 70306, +91 88401 90581, +91 88404 00235, +91 88406 87051, +91 88407 26331, +91 88408 44258, +91 88408 65408, +91 88532 30071, +91 88534 69741, +91 88580 53278, +91 88584 17885, +91 88585 24886, +91 88585 35539, +91 88586 26586, +91 88586 30009, +91 88587 22462, +91 88588 45459, +91 88876 02255, +91 88877 31390, +91 89220 90451, +91 89228 52589, +91 89228 52868, +91 89229 76029, +91 89249 66363, +91 89318 28104, +91 89318 84438, +91 89328 22313, +91 89530 16720, +91 89534 08687, +91 89570 08111, +91 89600 59778, +91 90053 15714, +91 90053 46005, +91 90054 43071, +91 90055 22892, +91 90056 70521, +91 90059 27729, +91 90059 31338, +91 90260 07626, +91 90262 14433, +91 90263 35717, +91 90264 36678, +91 90264 89049, +91 90274 24221, +91 90447 06791, +91 91125 66332, +91 91189 12004, +91 91204 58320, +91 91253 37735, +91 91257 68960, +91 91292 55337, +91 91400 63360, +91 91404 60822, +91 91610 93285, +91 91612 16145, +91 91619 56407, +91 91701 62253, +91 91706 41452, +91 91706 71388, +91 91981 88944, +91 91982 11334, +91 91984 01793, +91 91984 39110, +91 91988 73158, +91 92359 19491, +91 93360 24212, +91 93692 08406, +91 93694 58843, +91 93890 34834, +91 94109 00233, +91 94119 92134, +91 94150 12354, +91 94151 43709, +91 94151 48632, +91 94152 41616, +91 94152 47682, +91 94152 65401, +91 94152 71733, +91 94152 92736, +91 94153 06336, +91 94153 07426, +91 94153 24411, +91 94153 61543, +91 94154 37663, +91 94154 45145, +91 94154 45632, +91 94155 15757, +91 94155 97560, +91 94155 97776, +91 94156 25702, +91 94156 31127, +91 94157 55877, +91 94157 74204, +91 94158 08927, +91 94158 12421, +91 94158 14030, +91 94158 19150, +91 94158 34203, +91 94158 59788, +91 94158 67821, +91 94158 70234, +91 94158 93843, +91 94159 77270, +91 94159 77319, +91 94159 78381, +91 94159 88319, +91 94159 90419, +91 94159 92913, +91 94501 12205, +91 94501 80064, +91 94502 20765, +91 94502 37254, +91 94502 41116, +91 94502 42472, +91 94502 42594, +91 94502 43486, +91 94502 43587, +91 94502 45968, +91 94502 51782, +91 94503 18374, +91 94503 21261, +91 94503 32197, +91 94503 38116, +91 94503 55811, +91 94503 88305, +91 94503 97204, +91 94504 21322, +91 94505 46917, +91 94505 92441, +91 94507 18107, +91 94507 87478, +91 94507 88262, +91 94508 20870, +91 94508 27362, +91 94508 49092, +91 94508 54777, +91 94508 72010, +91 94508 77005, +91 94509 89664, +91 94510 34925, +91 94511 04828, +91 94511 20585, +91 94511 79174, +91 94512 00153, +91 94512 15566, +91 94512 26979, +91 94512 27002, +91 94512 28029, +91 94512 45399, +91 94512 69395, +91 94512 70178, +91 94514 54176, +91 94514 80676, +91 94514 93498, +91 94514 93929, +91 94515 09252, +91 94515 24495, +91 94515 27885, +91 94515 74806, +91 94515 84286, +91 94515 88229, +91 94516 69225, +91 94517 21127, +91 94517 24273, +91 94517 24301, +91 94517 37539, +91 94518 50110, +91 94518 50755, +91 94518 63932, +91 94518 87007, +91 94518 89515, +91 94519 46302, +91 94519 63716, +91 94519 92473, +91 94520 03759, +91 94520 15450, +91 94520 31121, +91 94520 61068, +91 94521 54162, +91 94522 75402, +91 94522 81435, +91 94522 81627, +91 94522 96090, +91 94523 07602, +91 94523 67710, +91 94524 15158, +91 94525 63321, +91 94525 68817, +91 94527 14459, +91 94528 83769, +91 94529 02051, +91 94529 24745, +91 94529 77009, +91 94530 44767, +91 94531 05972, +91 94532 19212, +91 94533 02490, +91 94533 25099, +91 94533 31610, +91 94533 80051, +91 94534 52668, +91 94534 99876, +91 94535 95121, +91 94536 38616, +91 94537 60571, +91 94537 84828, +91 94537 90427, +91 94539 49494, +91 94540 40707, +91 94541 25960, +91 94541 42167, +91 94541 64660, +91 94541 66670, +91 94542 24477, +91 94542 30325, +91 94542 30652, +91 94542 67892, +91 94544 19709, +91 94546 95423, +91 94547 08954, +91 94547 16127, +91 94547 36796, +91 94550 51445, +91 94550 92026, +91 94551 43029, +91 94552 24433, +91 94553 21130, +91 94554 49616, +91 94554 71478, +91 94554 73770, +91 94554 84831, +91 94555 88940, +91 94556 22109, +91 94556 64473, +91 94557 41616, +91 94557 94189, +91 94558 69181, +91 94559 61244, +91 94570 00083, +91 94574 79253, +91 94582 20666, +91 94737 91521, +91 95060 20365, +91 95060 41786, +91 95061 32098, +91 95063 91381, +91 95064 16698, +91 95064 93795, +91 95197 37095, +91 95320 21195, +91 95325 23050, +91 95541 99660, +91 95547 61057, +91 95557 95620, +91 95591 22520, +91 95594 40623, +91 95654 60162, +91 95656 61419, +91 95800 48484, +91 95981 70441, +91 95989 79695, +91 96160 39409, +91 96166 36189, +91 96166 75407, +91 96168 11715, +91 96169 78119, +91 96212 14030, +91 96213 81096, +91 96289 37512, +91 96289 76580, +91 96289 77913, +91 96483 50668, +91 96510 10328, +91 96512 06502, +91 96512 45638, +91 96513 52832, +91 96516 33834, +91 96704 04842, +91 96706 26227, +91 96708 87941, +91 96950 73489, +91 96952 80563, +91 96954 06363, +91 96954 19297, +91 96956 30859, +91 96958 11928, +91 96958 39294, +91 96958 40200, +91 96963 66060, +91 96966 47009, +91 97198 22662, +91 97210 38788, +91 97563 42626, +91 97924 88329, +91 97930 03835, +91 97930 56095, +91 97935 86891, +91 97938 53473, +91 97942 67340, +91 97943 59209, +91 97946 10109, +91 97946 88893, +91 97946 90606, +91 97947 86755, +91 97948 36608, +91 97950 53593, +91 97950 99478, +91 97951 11242, +91 97952 54590, +91 97952 81792, +91 97953 51657, +91 97953 78185, +91 97955 81756, +91 98387 59141, +91 98391 35947, +91 98391 88838, +91 98393 39752, +91 98395 41818, +91 98396 05757, +91 98686 17991, +91 98890 55227, +91 98890 96696, +91 98893 20743, +91 98893 29117, +91 98893 58846, +91 98895 99586, +91 98896 23199, +91 98896 35766, +91 99181 47429, +91 99182 90620, +91 99189 70303, +91 99189 82114, +91 99190 46150, +91 99190 48383, +91 99190 50905, +91 99194 10295, +91 99194 77225, +91 99195 49234, +91 99352 43553, +91 99352 56594, +91 99354 18848, +91 99354 33016, +91 99354 84976, +91 99355 19952, +91 99355 33552, +91 99356 52616, +91 99356 98666, +91 99357 95787, +91 99361 28102, +91 99363 02454, +91 99363 89377, +91 99364 99536, +91 99366 21051, +91 99367 28904, +91 99367 44726, +91 99368 07093, +91 99562 66959, +91 99562 73305, +91 99563 33613, +91 99565 68240, +91 99565 69919, +91 99567 72614, +91 99569 27370, +91 99569 73236, +91 99815 51162, +91 99840 56481, +91 99842 35760, +91 99846 27456"; // Paste your input text here // Prefix to remove string prefixToRemove = "+91"; // Split the input text by commas to get individual phone numbers string[] phoneNumbers = inputText.Split(','); // Remove the prefix and spaces from each phone number for (int i = 0; i < phoneNumbers.Length; i++) { // Trim any leading or trailing whitespaces phoneNumbers[i] = phoneNumbers[i].Trim(); // Check if the phone number starts with the specified prefix if (phoneNumbers[i].StartsWith(prefixToRemove)) { // Remove the prefix phoneNumbers[i] = phoneNumbers[i].Remove(0, prefixToRemove.Length); } // Remove spaces from the phone number phoneNumbers[i] = phoneNumbers[i].Replace(" ", ""); Console.WriteLine(phoneNumbers[i]); } } }
Write, Run & Share C# code online using OneCompiler's C# online compiler for free. It's one of the robust, feature-rich online compilers for C# language, running on the latest version 8.0. Getting started with the OneCompiler's C# compiler is simple and pretty fast. The editor shows sample boilerplate code when you choose language as C#
and start coding.
OneCompiler's C# online compiler supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample program which takes name as input and print your name with hello.
using System;
namespace Sample
{
class Test
{
public static void Main(string[] args)
{
string name;
name = Console.ReadLine();
Console.WriteLine("Hello {0} ", name);
}
}
}
C# is a general purpose object-oriented programming language by Microsoft. Though initially it was developed as part of .net but later it was approved by ECMA and ISO standards.
You can use C# to create variety of applications, like web, windows, mobile, console applications and much more using Visual studio.
Data Type | Description | Range | size |
---|---|---|---|
int | To store integers | -2,147,483,648 to 2,147,483,647 | 4 bytes |
double | to store large floating point numbers with decimals | can store 15 decimal digits | 8 bytes |
float | to store floating point numbers with decimals | can store upto 7 decimal digits | 4 bytes |
char | to store single characters | - | 2 bytes |
string | to stores text | - | 2 bytes per character |
bool | to stores either true or false | - | 1 bit |
datatype variable-name = value;
When ever you want to perform a set of operations based on a condition or set of few conditions IF-ELSE is used.
if(conditional-expression) {
// code
}
else {
// code
}
You can also use if-else for nested Ifs and If-Else-If ladder when multiple conditions are to be performed on a single variable.
Switch is an alternative to If-Else-If ladder.
switch(conditional-expression) {
case value1:
// code
break; // optional
case value2:
// code
break; // optional
...
default:
// code to be executed when all the above cases are not matched;
}
For loop is used to iterate a set of statements based on a condition.
for(Initialization; Condition; Increment/decrement) {
// code
}
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while(condition) {
// code
}
Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.
do {
// code
} while (condition);
Array is a collection of similar data which is stored in continuous memory addresses. Array values can be fetched using index. Index starts from 0 to size-1.
data-type[] array-name;
Method is a set of statements which gets executed only when they are called. Call the method name in the main function to execute the method.
static void method-name()
{
// code to be executed
}